<?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_Styles.Views.MainView">
  <ContentPage.Resources>
    <ResourceDictionary>

      <Style TargetType="Button">
        <Setter Property="HorizontalOptions" Value="Center" />
        <Setter Property="VerticalOptions" Value="Center" />
        <Setter Property="TextColor" Value="Red" />
      </Style>

      <Style x:Key="ButtonStyle" TargetType="Button">
        <Setter Property="HorizontalOptions" Value="Center" />
        <Setter Property="VerticalOptions" Value="Center" />
        <Setter Property="TextColor" Value="Green" />
      </Style>

      <Style x:Key="InheritedButtonStyle" TargetType="Button" BasedOn="{StaticResource ButtonStyle}">
        <Setter Property="BorderColor" Value="Green" />
        <Setter Property="FontSize" Value="Large" />
      </Style>

    </ResourceDictionary>
  </ContentPage.Resources>
  <StackLayout Padding="20">
    <Button
      TextColor="Yellow"
      Text="Sin Estilo" />
    <Button
       Text="Estilo como recurso del botón">
      <Button.Style>
        <Style TargetType="Button">
          <Setter Property="TextColor" Value="Blue" />
        </Style>
      </Button.Style>
    </Button>
    <Button
        Text="Estilo Explícito"
        Style="{StaticResource ButtonStyle}"/>
    <Button
        Text="Estilo Implícito" />
    <Button
        Text="Herencia de Estilos"
        Style="{StaticResource InheritedButtonStyle}"/>
  </StackLayout>
</ContentPage>