<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Bili.App.Controls">
    <Style TargetType="local:OffsetButton">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Margin" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:OffsetButton">
                    <Border
                        x:Name="Root"
                        Background="{ThemeResource FlipViewNextPreviousButtonBackground}"
                        BorderBrush="{ThemeResource FlipViewNextPreviousButtonBorderBrush}"
                        BorderThickness="{ThemeResource FlipViewButtonBorderThemeThickness}"
                        CornerRadius="{ThemeResource ControlCornerRadius}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource FlipViewNextPreviousArrowForegroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource FlipViewNextPreviousButtonBackgroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource FlipViewNextPreviousButtonBorderBrushPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource FlipViewNextPreviousArrowForegroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames
                                            RepeatBehavior="Forever"
                                            Storyboard.TargetName="ScaleTransform"
                                            Storyboard.TargetProperty="ScaleX">
                                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.016" Value="{ThemeResource FlipViewButtonScalePressed}" />
                                            <DiscreteDoubleKeyFrame KeyTime="0:0:30" Value="{ThemeResource FlipViewButtonScalePressed}" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames
                                            RepeatBehavior="Forever"
                                            Storyboard.TargetName="ScaleTransform"
                                            Storyboard.TargetProperty="ScaleY">
                                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.016" Value="{ThemeResource FlipViewButtonScalePressed}" />
                                            <DiscreteDoubleKeyFrame KeyTime="0:0:30" Value="{ThemeResource FlipViewButtonScalePressed}" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <FontIcon
                            x:Name="Arrow"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            FontFamily="{ThemeResource SymbolThemeFontFamily}"
                            FontSize="{ThemeResource FlipViewButtonFontSize}"
                            Foreground="{ThemeResource FlipViewNextPreviousArrowForeground}"
                            Glyph="{TemplateBinding Glyph}"
                            MirroredWhenRightToLeft="True"
                            RenderTransformOrigin="0.5, 0.5"
                            UseLayoutRounding="False">
                            <FontIcon.RenderTransform>
                                <ScaleTransform x:Name="ScaleTransform" ScaleX="1" ScaleY="1" />
                            </FontIcon.RenderTransform>
                        </FontIcon>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
