<?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="WorkingWithStyles.StyleXaml">
	<ContentPage.Resources>
		<ResourceDictionary>
			<Style x:Key="CustomStyle" TargetType="Label" BaseResourceKey="SubtitleStyle">
				<Setter Property="Label.TextColor" Value="Color.Pink"/>
			</Style>
			<Style x:Key="ButtonStyle" TargetType="Button">
				<Setter Property="BackgroundColor" Value="Yellow"/>
				<Setter Property="BorderRadius" Value="0"/>
				<Setter Property="HeightRequest" Value="42"/>
			</Style>
			<Style TargetType="BoxView">
				<Setter Property="Color" Value="Blue"/>
			</Style>
		</ResourceDictionary>
	</ContentPage.Resources>
	<StackLayout Padding="0,20,0,0">
		<Label Text="This uses TitleStyle in XAML" Style="{DynamicResource TitleStyle}"/>
		<Label Text="This uses SubtitleStyle in XAML" Style="{DynamicResource SubtitleStyle}"/>
		<Label Text="This uses BodyStyle in XAML" Style="{DynamicResource BodyStyle}"/>
		<Label Text="This uses CaptionStyle in XAML" Style="{DynamicResource CaptionStyle}"/>

		<Button Text="Style Me XAML" Style="{StaticResource ButtonStyle}" />

		<!-- defined above in the Page's ResourceDictionary -->
		<Label Text="This uses a custom style dynamically inherited from SubtitleStyle in XAML" 
				Style="{StaticResource CustomStyle}"/>
		
		<!-- defined in the Application's global ResourceDictionary -->
		<Label Text="This uses a custom style inherited dynamically from the Application ResourceDictionary" 
				Style="{StaticResource AppStyle}"/>

		<!-- uses implicit style that applies to all BoxViews, 
			 the one in the Page above overrides the App-level one -->
		<BoxView />

	</StackLayout>
</ContentPage>