<Window x:Class="StaticAndDynamicResources.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="171" Width="444">
    <Grid Name="grid">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <!--kolor-->
            <LinearGradientBrush x:Key="textBlockBackground" StartPoint="0,0" EndPoint="1,1">
                <GradientStop Color="CornflowerBlue" Offset="0"/>
                <GradientStop Color="White" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <GroupBox Grid.Column="0"  Header="Tło - zasób statyczny" >
            <TextBlock  Background="{StaticResource textBlockBackground}">Element TextBlock</TextBlock>
        </GroupBox>
        <GroupBox Grid.Column="1" Header="Tło - zasób dynamiczny" >
            <TextBlock  Background="{DynamicResource textBlockBackground}">Element TextBlock</TextBlock>
        </GroupBox>
        <Button x:Name="przycisk" Margin="5" Grid.Column="2" Click="Button_Click">Zmień zasób</Button>
    </Grid>
</Window>
