47 строки
1.7 KiB
XML
47 строки
1.7 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.OnPlatform">
|
|
<ContentPage.Resources>
|
|
<ResourceDictionary>
|
|
<OnPlatform x:TypeArguments="FontAttributes" x:Key="fontAttributes">
|
|
<OnPlatform.iOS>Bold</OnPlatform.iOS>
|
|
<OnPlatform.Android>Italic</OnPlatform.Android>
|
|
</OnPlatform>
|
|
<OnPlatform x:Key="phone" x:TypeArguments="x:Double" iOS="20" Android="20" WinPhone="30"/>
|
|
<OnPlatform x:Key="tablet" x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="60"/>
|
|
<OnIdiom x:Key="fontSize" x:TypeArguments="x:Double"
|
|
Phone="{StaticResource phone}"
|
|
Tablet="{StaticResource tablet}"/>
|
|
|
|
</ResourceDictionary>
|
|
</ContentPage.Resources>
|
|
<StackLayout>
|
|
<Label x:Name="label0" FontAttributes="{StaticResource fontAttributes}" FontSize="{StaticResource fontSize}">
|
|
<Label.IsVisible>
|
|
<OnPlatform x:TypeArguments="x:Boolean">
|
|
<OnPlatform.iOS>true</OnPlatform.iOS>
|
|
<OnPlatform.Android>false</OnPlatform.Android>
|
|
</OnPlatform>
|
|
</Label.IsVisible>
|
|
<Label.WidthRequest>
|
|
<OnPlatform x:TypeArguments="x:Double">
|
|
<OnPlatform.iOS>20</OnPlatform.iOS>
|
|
<OnPlatform.Android>30</OnPlatform.Android>
|
|
</OnPlatform>
|
|
</Label.WidthRequest>
|
|
<Label.Text>
|
|
<OnPlatform x:TypeArguments="x:String">
|
|
<OnPlatform.iOS>Foo</OnPlatform.iOS>
|
|
<OnPlatform.Android>Bar</OnPlatform.Android>
|
|
</OnPlatform>
|
|
</Label.Text>
|
|
<Label.HeightRequest>
|
|
<OnPlatform x:TypeArguments="x:Double" Default="63">
|
|
<On Platform="iOS">21</On>
|
|
<On Platform="Android, FooBar">42</On>
|
|
</OnPlatform>
|
|
</Label.HeightRequest>
|
|
</Label>
|
|
</StackLayout>
|
|
</ContentPage> |