<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls">

    <sys:Double x:Key="FlipViewButtonFontSize">8</sys:Double>
    <sys:Double x:Key="FlipViewButtonFontSizePointerOver">9</sys:Double>
    <sys:Double x:Key="FlipViewButtonFontSizePressed">7</sys:Double>

    <Style x:Key="DefaultFlipViewStyle" TargetType="Controls:FlipView">
        <Setter Property="Background" Value="{DynamicResource FlipViewBackground}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
        <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
        <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="IsBannerEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:FlipView">
                    <ControlTemplate.Resources>
                        <StreamGeometry x:Key="CaretLeft">F1 M 5 10 L 15 0 L 15 20 L 5 10 Z</StreamGeometry>
                        <StreamGeometry x:Key="CaretRight">F1 M 5 0 L 15 10 L 5 20 L 5 0 Z</StreamGeometry>
                        <StreamGeometry x:Key="CaretUp">F1 M 10 5 L 20 15 L 0 15 L 10 5 Z</StreamGeometry>
                        <StreamGeometry x:Key="CaretDown">F1 M 0 5 L 20 5 L 10 15 L 0 5 Z</StreamGeometry>
                        <Storyboard x:Key="ShowBannerStoryboard">
                            <DoubleAnimation
                                AccelerationRatio="1.0"
                                SpeedRatio="2.5"
                                Storyboard.TargetProperty="Height"
                                To="30.0" />
                        </Storyboard>
                        <Storyboard x:Key="HideBannerStoryboard">
                            <DoubleAnimation
                                AccelerationRatio="1.0"
                                SpeedRatio="2.5"
                                Storyboard.TargetProperty="Height"
                                To="0.0" />
                        </Storyboard>
                        <Storyboard x:Key="HideControlStoryboard">
                            <DoubleAnimation
                                AccelerationRatio="1.0"
                                SpeedRatio="2.5"
                                Storyboard.TargetProperty="Opacity"
                                To="0.0" />
                        </Storyboard>
                        <Storyboard x:Key="ShowControlStoryboard">
                            <DoubleAnimation
                                AccelerationRatio="1.0"
                                SpeedRatio="2.5"
                                Storyboard.TargetProperty="Opacity"
                                To="1.0" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                        ClipToBounds="True">
                        <Grid>
                            <Grid.Resources>
                                <ControlTemplate x:Key="HorizontalNextTemplate" TargetType="Button">
                                    <Border
                                        x:Name="Root"
                                        Background="{DynamicResource FlipViewNextPreviousButtonBackground}"
                                        BorderThickness="{DynamicResource FlipViewButtonBorderThemeThickness}"
                                        BorderBrush="{DynamicResource FlipViewNextPreviousButtonBorderBrush}"
                                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
                                        <ui:FontIconFallback
                                            x:Name="Arrow"
                                            FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                            FontSize="{DynamicResource FlipViewButtonFontSize}"
                                            Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
                                            Data="{StaticResource CaretRight}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            UseLayoutRounding="False" />
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalPreviousTemplate" TargetType="Button">
                                    <Border
                                        x:Name="Root"
                                        Background="{DynamicResource FlipViewNextPreviousButtonBackground}"
                                        BorderThickness="{DynamicResource FlipViewButtonBorderThemeThickness}"
                                        BorderBrush="{DynamicResource FlipViewNextPreviousButtonBorderBrush}"
                                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
                                        <ui:FontIconFallback
                                            x:Name="Arrow"
                                            FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                            FontSize="{DynamicResource FlipViewButtonFontSize}"
                                            Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
                                            Data="{StaticResource CaretLeft}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            UseLayoutRounding="False" />
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalNextTemplate" TargetType="Button">
                                    <Border
                                        x:Name="Root"
                                        Background="{DynamicResource FlipViewNextPreviousButtonBackground}"
                                        BorderThickness="{DynamicResource FlipViewButtonBorderThemeThickness}"
                                        BorderBrush="{DynamicResource FlipViewNextPreviousButtonBorderBrush}"
                                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
                                        <ui:FontIconFallback
                                            x:Name="Arrow"
                                            FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                            FontSize="{DynamicResource FlipViewButtonFontSize}"
                                            Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
                                            Data="{StaticResource CaretDown}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            UseLayoutRounding="False" />
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalPreviousTemplate" TargetType="Button">
                                    <Border
                                        x:Name="Root"
                                        Background="{DynamicResource FlipViewNextPreviousButtonBackground}"
                                        BorderThickness="{DynamicResource FlipViewButtonBorderThemeThickness}"
                                        BorderBrush="{DynamicResource FlipViewNextPreviousButtonBorderBrush}"
                                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
                                        <ui:FontIconFallback
                                            x:Name="Arrow"
                                            FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                            FontSize="{DynamicResource FlipViewButtonFontSize}"
                                            Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
                                            Data="{StaticResource CaretUp}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            UseLayoutRounding="False" />
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
                                            <Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
                                            <Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
                                            <Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Grid.Resources>
                            <Controls:TransitioningContentControl
                                x:Name="PART_Presenter"
                                Content="{TemplateBinding SelectedItem}"
                                ContentStringFormat="{TemplateBinding ItemStringFormat}"
                                ContentTemplate="{TemplateBinding ItemTemplate}"
                                ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                Padding="{TemplateBinding Padding}"
                                IsTabStop="False" />
                            <Button
                                x:Name="PART_BackButton"
                                Template="{StaticResource HorizontalPreviousTemplate}"
                                Width="16"
                                Height="38"
                                Margin="1"
                                ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                                IsTabStop="False"
                                FocusVisualStyle="{x:Null}"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Visibility="Hidden" />
                            <Button
                                x:Name="PART_ForwardButton"
                                Template="{StaticResource HorizontalNextTemplate}"
                                Width="16"
                                Height="38"
                                Margin="1"
                                ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                                IsTabStop="False"
                                FocusVisualStyle="{x:Null}"
                                HorizontalAlignment="Right"
                                VerticalAlignment="Center"
                                Visibility="Hidden" />
                            <Button
                                x:Name="PART_UpButton"
                                Template="{StaticResource VerticalPreviousTemplate}"
                                Width="38"
                                Height="16"
                                Margin="1"
                                ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                                IsTabStop="False"
                                FocusVisualStyle="{x:Null}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"
                                Visibility="Hidden" />
                            <Button
                                x:Name="PART_DownButton"
                                Template="{StaticResource VerticalNextTemplate}"
                                Width="38"
                                Height="16"
                                Margin="1"
                                ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                                IsTabStop="False"
                                FocusVisualStyle="{x:Null}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Bottom"
                                Visibility="Hidden" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=(SystemParameters.ClientAreaAnimation)}" Value="False">
                            <Setter Property="LeftTransition" Value="Normal" />
                            <Setter Property="RightTransition" Value="Normal" />
                            <Setter Property="UpTransition" Value="Normal" />
                            <Setter Property="DownTransition" Value="Normal" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Controls:FlipView" BasedOn="{StaticResource DefaultFlipViewStyle}" />

</ResourceDictionary>