<Window x:Class="AnimationInStyleDefinition.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Window.Background>
        <ImageBrush ViewportUnits="Absolute" TileMode="Tile" Viewport="0,0,500,500">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="Images\background.png"/>
            </ImageBrush.ImageSource>
        </ImageBrush>
    </Window.Background>
    <Window.Resources>
        <Style TargetType="{x:Type Button}">
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="Padding" Value="10"/>
            <Setter Property="Opacity" Value="0.4"/>
            <!--settery dla animownych właściowści-->
            <Setter Property="LayoutTransform">
                <Setter.Value>
                    <RotateTransform/>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <!--animacja powiększająca przycisk zdefiniowana w wyzwalaczu EventTrigger-->
                <EventTrigger RoutedEvent="Button.MouseEnter">
                    <BeginStoryboard HandoffBehavior="Compose">
                        <Storyboard>
                            <DoubleAnimation 
                     Duration="0:0:1" Storyboard.TargetProperty="LayoutTransform.Angle" To="720"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="Button.MouseLeave">
                    <BeginStoryboard HandoffBehavior="Compose">
                        <Storyboard>
                            <DoubleAnimation 
                     Duration="0:0:1" Storyboard.TargetProperty="LayoutTransform.Angle"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>

            </Style.Triggers>
        </Style>
    </Window.Resources>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
        <Button>1</Button>
        <Button>2</Button>
        <Button>3</Button>
        <Button>4</Button>
        <Button>5</Button>
        <Button>6</Button>
        <Button>7</Button>
    </StackPanel>
</Window>