Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Added repro sample (#13095)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuarezruiz committed Dec 11, 2020
1 parent 582fdb3 commit db7ca13
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.Forms.Controls.GalleryPages.ShapesGalleries.ShapeAppThemeGallery"
Title="Shapes AppTheme Gallery">
<ContentPage.Resources>

<Style x:Key="LayoutAppThemeStyle" TargetType="StackLayout">
<Setter Property="BackgroundColor" Value="{AppThemeBinding White, Light=White, Dark=Black}" />
<Setter Property="Padding" Value="12" />
</Style>

<Style x:Key="LabelAppThemeStyle" TargetType="Label">
<Setter Property="TextColor" Value="{AppThemeBinding Black, Light=Green, Dark=Red}" />
</Style>

<Style x:Key="ShapeAppThemeStyle" TargetType="Rectangle">
<Setter Property="Stroke" Value="{AppThemeBinding Black, Light=Green, Dark=Red}" />
<Setter Property="Fill" Value="{AppThemeBinding Black, Light=Green, Dark=Red}" />
</Style>

</ContentPage.Resources>
<ContentPage.Content>
<StackLayout
Style="{DynamicResource LayoutAppThemeStyle}">
<Label
Style="{DynamicResource LabelAppThemeStyle}">Shape using AppTheme</Label>
<Rectangle
HorizontalOptions="Start"
HeightRequest="80"
WidthRequest="200"
Style="{DynamicResource ShapeAppThemeStyle}"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Xamarin.Forms.Controls.GalleryPages.ShapesGalleries
{
public partial class ShapeAppThemeGallery : ContentPage
{
public ShapeAppThemeGallery()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@ public ShapesGallery()
{
Title = "Shapes Gallery";

var button = new Button
{
Text = "Enable Shapes",
AutomationId = "EnableShapes"
};
button.Clicked += ButtonClicked;

Content = new ScrollView
{
Content = new StackLayout
{
Children =
{
button,
GalleryBuilder.NavButton("Ellipse Gallery", () => new EllipseGallery(), Navigation),
GalleryBuilder.NavButton("Line Gallery", () => new LineGallery(), Navigation),
GalleryBuilder.NavButton("Polygon Gallery", () => new PolygonGallery(), Navigation),
Expand All @@ -37,6 +29,7 @@ public ShapesGallery()
GalleryBuilder.NavButton("Transform Playground", () => new TransformPlaygroundGallery(), Navigation),
GalleryBuilder.NavButton("Path Transform using string (TypeConverter) Gallery", () => new PathTransformStringGallery(), Navigation),
GalleryBuilder.NavButton("Animate Shape Gallery", () => new AnimateShapeGallery(), Navigation),
GalleryBuilder.NavButton("Shape AppThemes Gallery", () => new ShapeAppThemeGallery(), Navigation),
GalleryBuilder.NavButton("Clip Gallery", () => new ClipGallery(), Navigation),
GalleryBuilder.NavButton("Clip CornerRadius Gallery", () => new ClipCornerRadiusGallery(), Navigation),
GalleryBuilder.NavButton("Clip Views Gallery", () => new ClipViewsGallery(), Navigation),
Expand All @@ -46,14 +39,5 @@ public ShapesGallery()
}
};
}

void ButtonClicked(object sender, System.EventArgs e)
{
var button = sender as Button;

button.Text = "Shapes Enabled!";
button.TextColor = Color.Black;
button.IsEnabled = false;
}
}
}

0 comments on commit db7ca13

Please sign in to comment.