maui-linux/Xamarin.Forms.Xaml.UnitTests/StyleTests.xaml

36 строки
1.5 KiB
XML

<?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.Xaml.UnitTests.StyleTests">
<ContentPage.Resources>
<ResourceDictionary>
<Style TargetType="Label">
<Setter Property="Label.TextColor" Value="Red"/>
</Style>
<Style x:Key="styleKey0" x:Name="style0" TargetType="Label">
<Setter Property="Label.Text" Value="FooBar"/>
<Setter Property="Label.BackgroundColor" Value="Pink"/>
</Style>
<Style x:Key="styleKey1" x:Name="style1" TargetType="Label">
<Setter Property="Label.Height" Value="42"/>
<Setter Property="Label.BackgroundColor" Value="Pink"/>
<Setter Property="Image.Source" Value="foo.png"/>
</Style>
<Style TargetType="Label" x:Key="style0" x:Name="style2">
<Setter Property="Text" Value="foo"/>
<Setter Property="BackgroundColor" Value="Red"/>
</Style>
<Style x:Key="labelStyle" TargetType="Label"
BaseResourceKey="TitleStyle">
<Setter Property="TextColor" Value="Red" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<StackLayout>
<Label x:Name="label0" Style="{StaticResource styleKey0}"/>
<Label x:Name="label1" />
<Label x:Name="labelWithStyleDerivedFromDynamic_StaticResource" Style="{StaticResource labelStyle}"/>
<Label x:Name="labelWithStyleDerivedFromDynamic_DynamicResource" Style="{DynamicResource labelStyle}"/>
</StackLayout>
</ContentPage>