﻿<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:s="clr-namespace:System;assembly=mscorlib"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Page.Resources>
    <Style
      x:Key="allButtons"
      TargetType="{x:Type Button}">
      <Setter Property="Foreground"
              Value="White"/>
      <Setter Property="Margin"
              Value="10"/>
      <Setter Property="FontSize"
              Value="48"/>
      <Setter Property="FontFamily"
              Value="Calibri"/>
      <Setter Property="HorizontalAlignment"
              Value="Center"/>
      <Setter Property="VerticalAlignment"
              Value="Center"/>
      <Setter Property="Background">
        <Setter.Value>
          <LinearGradientBrush StartPoint="0,0"
                               EndPoint="0,1">
            <GradientStop Offset="0"
                          Color="#FF64B7FF"/>
            <GradientStop Offset="0.508"
                          Color="#FF09487D"/>
            <GradientStop Offset="1"
                          Color="#FF002545"/>
          </LinearGradientBrush>
        </Setter.Value>
      </Setter>
    </Style>
    <!-- No name means target all buttons -->
    <Style
      BasedOn="{StaticResource allButtons}"
      TargetType="{x:Type Button}"/>
    <Style
      x:Key="derivedStyle"
      BasedOn="{StaticResource allButtons}"
      TargetType="{x:Type Button}">
      <Setter Property="Foreground"
              Value="Yellow"/>
    </Style>
  </Page.Resources>
  <StackPanel Background="Silver">
    <Button Content="Picking up default style"/>
    <Button
      Content="Explicit styling using derived styles"
      Style="{StaticResource derivedStyle}"/>
  </StackPanel>
</Page>
