<Window x:Class="AnimationInStyleDefinition.FishEyeAnimation"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="FishEyeAnimation" Height="300" Width="300">
    <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>
                    <ScaleTransform/>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <!--animacja powiększająca przycisk zdefiniowana w wyzwalaczu EventTrigger-->
                <EventTrigger RoutedEvent="Button.MouseEnter">
                    <EventTrigger.Actions>
                        <BeginStoryboard HandoffBehavior="Compose">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX"
To="2" Duration="0:0:0.20"/>
                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY"
To="2" Duration="0:0:0.20"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
                <!--animacja pomniejszająca przycisk zdefiniowana w wyzwalaczu EventTrigger-->
                <EventTrigger RoutedEvent="Button.MouseLeave">
                    <EventTrigger.Actions>
                        <BeginStoryboard HandoffBehavior="Compose">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX"
 Duration="0:0:0.20"/>
                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY"
 Duration="0:0:0.20"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </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>