<Window
  x:Class="AvCalc.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Width="260"
  Height="260" 
  Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
  Title="AvCalc">
  <Grid>
    <Grid.Resources>
      <Style x:Key="Thingie">
        <Setter Property="Control.Margin" Value="2" />
      </Style>
      <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource Thingie}">
        <Setter Property="Control.Margin" Value="5,2" />
      </Style>
      <Style TargetType="{x:Type Button}" BasedOn="{StaticResource Thingie}">
        <Setter Property="Width" Value="36" />
        <Setter Property="Height" Value="29" />
        <Setter Property="Foreground" Value="Blue" />
        <!-- Sept CTP -->
        <!--<Setter Property="Background" Value="VerticalGradient White LightGray" />-->
        <!-- Nov CTP and beyond -->
        <Setter Property="Background">
          <Setter.Value>
            <LinearGradientBrush>
              <LinearGradientBrush.GradientStops>
                <GradientStop Offset="0" Color="White" />
                <GradientStop Offset="1" Color="LightGray" />
              </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </Style>
    </Grid.Resources>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition />
      <ColumnDefinition />
      <ColumnDefinition />
      <ColumnDefinition />
      <ColumnDefinition />
      <ColumnDefinition />
    </Grid.ColumnDefinitions>
    <Menu Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="6">
      <MenuItem Header="Edit" />
      <MenuItem Header="View" />
      <MenuItem Header="Help" />
    </Menu>
    <TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="6">0.</TextBox>

    <TextBox Grid.Row="2" Grid.Column="0" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
    <Button Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Width="63" Foreground="Red">Backspace</Button>
    <Button Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="2" Width="63" Foreground="Red">CE</Button>
    <Button Grid.Row="2" Grid.Column="5" Foreground="Red">C</Button>

    <Button Grid.Row="3" Grid.Column="0" Foreground="Red">MC</Button>
    <Button Grid.Row="3" Grid.Column="1">7</Button>
    <Button Grid.Row="3" Grid.Column="2">8</Button>
    <Button Grid.Row="3" Grid.Column="3">9</Button>
    <Button Grid.Row="3" Grid.Column="4" Foreground="Red">/</Button>
    <Button Grid.Row="3" Grid.Column="5">sqrt</Button>

    <Button Grid.Row="4" Grid.Column="0" Foreground="Red">MR</Button>
    <Button Grid.Row="4" Grid.Column="1">4</Button>
    <Button Grid.Row="4" Grid.Column="2">5</Button>
    <Button Grid.Row="4" Grid.Column="3">6</Button>
    <Button Grid.Row="4" Grid.Column="4" Foreground="Red">*</Button>
    <Button Grid.Row="4" Grid.Column="5">%</Button>

    <Button Grid.Row="5" Grid.Column="0" Foreground="Red">MS</Button>
    <Button Grid.Row="5" Grid.Column="1">1</Button>
    <Button Grid.Row="5" Grid.Column="2">2</Button>
    <Button Grid.Row="5" Grid.Column="3">3</Button>
    <Button Grid.Row="5" Grid.Column="4" Foreground="Red">-</Button>
    <Button Grid.Row="5" Grid.Column="5">1/x</Button>

    <Button Grid.Row="6" Grid.Column="0" Foreground="Red">M+</Button>
    <Button Grid.Row="6" Grid.Column="1">0</Button>
    <Button Grid.Row="6" Grid.Column="2">+/-</Button>
    <Button Grid.Row="6" Grid.Column="3">.</Button>
    <Button Grid.Row="6" Grid.Column="4" Foreground="Red">+</Button>
    <Button Grid.Row="6" Grid.Column="5" Foreground="Red">=</Button>
  </Grid>
</Window>
