<Window x:Class="Stile.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Stile" Height="200" Width="450" Background="BlueViolet">

    <Window.Resources>
        <!-- Stil für Label-Elemente -->
        <Style TargetType="{x:Type Label}" >
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontSize" Value="24" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="FontSize" Value="32" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- Stil für beliebige Elemente mit den Eigenschaften Foreground-->
        <Style x:Key="whiteStyle">
            <Setter Property="Control.Foreground" Value="White" />
        </Style>
    </Window.Resources>


    <Grid>
        <Label Name="label1" Margin="0,30,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" HorizontalContentAlignment="Center">Hallo Welt!</Label>
        <Button Name="button1" Style="{StaticResource whiteStyle}" Click="button1_Click"  Margin="0,0,0,10" HorizontalAlignment="Center" VerticalAlignment="Bottom" Height="23" Width="75">Beenden</Button>
    </Grid>
</Window>
