<!-- Example 12-15. Using resources from markup -->

<Window x:Class="ResourcesExample.Window2" Title="Resources"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <Window.Resources>
    <SolidColorBrush x:Key="myBrush" Color="LightGreen" />
  </Window.Resources>

  <Grid Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
    <TextBlock FontSize="36" Width="200" Height="200"
               Background="{StaticResource myBrush}">Hello!</TextBlock>
  </Grid>
</Window>

<!-- End of Example 12-15. -->