<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="using:JumpPoint.Uwp"
                    xmlns:controls="using:JumpPoint.Uwp.Controls"
                    xmlns:winui="using:Microsoft.UI.Xaml.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///Resources/CustomStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="controls:Expander">
        <Setter Property="HeaderBackground"
                Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}" />
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch" />
        <Setter Property="VerticalContentAlignment"
                Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:Expander">
                    <Grid BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          Margin="{TemplateBinding Margin}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <ToggleButton IsChecked="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=IsOpen, Mode=TwoWay}"
                                      Background="{TemplateBinding HeaderBackground}"
                                      HorizontalAlignment="Stretch"
                                      HorizontalContentAlignment="Stretch"
                                      VerticalContentAlignment="Stretch"
                                      BorderThickness="0">
                            <Grid ColumnSpacing="12"
                                  Background="Transparent"
                                  Padding="4">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <FontIcon x:Name="Icon"
                                          FontFamily="Segoe MDL2 Assets"
                                          FontSize="12"
                                          Glyph="&#xE76C;"
                                          RenderTransformOrigin="0.5,0.5">
                                    <FontIcon.RenderTransform>
                                        <RotateTransform x:Name="rotateTransform" />
                                    </FontIcon.RenderTransform>
                                </FontIcon>
                                <ContentPresenter Grid.Column="1"
                                                  HorizontalAlignment="Stretch"
                                                  VerticalAlignment="Stretch"
                                                  HorizontalContentAlignment="Stretch"
                                                  VerticalContentAlignment="Stretch"
                                                  Content="{TemplateBinding Header}"
                                                  ContentTemplate="{TemplateBinding HeaderTemplate}" />
                            </Grid>
                        </ToggleButton>
                        <ContentPresenter x:Name="ContentPresenter"
                                          Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=IsOpen, Converter={StaticResource VisibleWhenTrueConverter}}"
                                          Grid.Row="1"
                                          Padding="{TemplateBinding Padding}"
                                          Background="{TemplateBinding Background}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          HorizontalContentAlignment="Stretch"
                                          VerticalContentAlignment="Stretch" />
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ExpandedStates">
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="0:0:0"
                                                         Storyboard.TargetName="rotateTransform"
                                                         Storyboard.TargetProperty="Angle"
                                                         To="90.0"
                                                         Duration="0:0:0.1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="0:0:0"
                                                         Storyboard.TargetName="rotateTransform"
                                                         Storyboard.TargetProperty="Angle"
                                                         To="0.0"
                                                         Duration="0:0:0.1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:MarkdownViewer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:MarkdownViewer">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:IconButton">
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Foreground"
                Value="{ThemeResource ButtonForeground}" />
        <Setter Property="BorderBrush"
                Value="{ThemeResource ButtonBorderBrush}" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="Padding"
                Value="8,3,8,4" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="FontFamily"
                Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight"
                Value="Normal" />
        <Setter Property="FontSize"
                Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="UseSystemFocusVisuals"
                Value="{StaticResource UseSystemFocusVisuals}" />
        <Setter Property="FocusVisualMargin"
                Value="-3" />
        <Setter Property="CornerRadius"
                Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:IconButton">
                    <Grid x:Name="RootGrid"
                          Background="{TemplateBinding Background}"
                          CornerRadius="{TemplateBinding CornerRadius}">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBackgroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBorderBrushPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonForegroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonForegroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBackgroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBorderBrushPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonForegroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonForegroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <PointerDownThemeAnimation Storyboard.TargetName="RootGrid" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBackgroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBorderBrushDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid x:Name="InnerGrid"
                              Padding="{TemplateBinding Padding}"
                              BorderBrush="{TemplateBinding BorderBrush}"
                              BorderThickness="{TemplateBinding BorderThickness}"
                              CornerRadius="{TemplateBinding CornerRadius}">

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <IconSourceElement x:Name="Icon"
                                               IconSource="{TemplateBinding IconSource}" />

                            <ContentPresenter x:Name="ContentPresenter"
                                              Grid.Column="1"
                                              Padding="8,0,0,0"
                                              Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=IsCompact, Converter={StaticResource NegateBooleanConverter}}"
                                              Content="{TemplateBinding Content}"
                                              ContentTransitions="{TemplateBinding ContentTransitions}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                              VerticalAlignment="Center"
                                              AutomationProperties.AccessibilityView="Raw" />
                        </Grid>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:IconSplitButton">
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Foreground"
                Value="{ThemeResource SplitButtonForeground}" />
        <Setter Property="BorderBrush"
                Value="{ThemeResource SplitButtonBorderBrush}" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="FontFamily"
                Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight"
                Value="Normal" />
        <Setter Property="FontSize"
                Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="UseSystemFocusVisuals"
                Value="True" />
        <Setter Property="FocusVisualMargin"
                Value="-3" />
        <Setter Property="IsTabStop"
                Value="True" />
        <Setter Property="Padding"
                Value="{ThemeResource ButtonPadding}" />
        <Setter Property="CornerRadius"
                Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:IconSplitButton">
                    <Grid x:Name="RootGrid"
                          Background="Transparent"
                          CornerRadius="{TemplateBinding CornerRadius}">

                        <Grid.Resources>
                            <!-- Override the style of the inner buttons so that they don't affect background/foreground/border colors -->
                            <Style TargetType="controls:IconButton">
                                <Setter Property="Background"
                                        Value="Transparent" />
                                <Setter Property="Foreground"
                                        Value="{ThemeResource SplitButtonForeground}" />
                                <Setter Property="BorderBrush"
                                        Value="Transparent" />
                                <Setter Property="BorderThickness"
                                        Value="{ThemeResource SplitButtonBorderThemeThickness}" />
                                <Setter Property="HorizontalAlignment"
                                        Value="Left" />
                                <Setter Property="VerticalAlignment"
                                        Value="Center" />
                                <Setter Property="FontFamily"
                                        Value="{ThemeResource ContentControlThemeFontFamily}" />
                                <Setter Property="FontWeight"
                                        Value="Normal" />
                                <Setter Property="FontSize"
                                        Value="{ThemeResource ControlContentThemeFontSize}" />
                                <Setter Property="UseSystemFocusVisuals"
                                        Value="{StaticResource UseSystemFocusVisuals}" />
                                <Setter Property="FocusVisualMargin"
                                        Value="-3" />
                            </Style>
                            <Style TargetType="Button">
                                <Setter Property="Background"
                                        Value="Transparent" />
                                <Setter Property="Foreground"
                                        Value="{ThemeResource SplitButtonForeground}" />
                                <Setter Property="BorderBrush"
                                        Value="Transparent" />
                                <Setter Property="BorderThickness"
                                        Value="{ThemeResource SplitButtonBorderThemeThickness}" />
                                <Setter Property="HorizontalAlignment"
                                        Value="Left" />
                                <Setter Property="VerticalAlignment"
                                        Value="Center" />
                                <Setter Property="FontFamily"
                                        Value="{ThemeResource ContentControlThemeFontFamily}" />
                                <Setter Property="FontWeight"
                                        Value="Normal" />
                                <Setter Property="FontSize"
                                        Value="{ThemeResource ControlContentThemeFontSize}" />
                                <Setter Property="UseSystemFocusVisuals"
                                        Value="{StaticResource UseSystemFocusVisuals}" />
                                <Setter Property="FocusVisualMargin"
                                        Value="-3" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid x:Name="RootGrid"
                                                  Background="Transparent">

                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />

                                                        <VisualState x:Name="Disabled">
                                                            <VisualState.Setters>
                                                                <Setter Target="ContentPresenter.Foreground"
                                                                        Value="{ThemeResource SplitButtonForegroundDisabled}" />
                                                            </VisualState.Setters>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>

                                                <ContentPresenter x:Name="ContentPresenter"
                                                                  BorderBrush="{TemplateBinding BorderBrush}"
                                                                  BorderThickness="{TemplateBinding BorderThickness}"
                                                                  Content="{TemplateBinding Content}"
                                                                  ContentTransitions="{TemplateBinding ContentTransitions}"
                                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                  Padding="{TemplateBinding Padding}"
                                                                  HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                                  AutomationProperties.AccessibilityView="Raw" />
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />

                                <VisualState x:Name="FlyoutOpen">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPressed}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPressed}" />
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushPressed}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPressed}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPressed}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="TouchPressed">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPressed}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPressed}" />
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushPressed}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPressed}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPressed}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="PrimaryPointerOver">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPointerOver}" />
                                        <Setter Target="PrimaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushPointerOver}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPointerOver}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackground}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="PrimaryPressed">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPressed}" />
                                        <Setter Target="PrimaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushPressed}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPressed}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackground}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="SecondaryPointerOver">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackground}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPointerOver}" />
                                        <Setter Target="SecondaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushPointerOver}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPointerOver}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="SecondaryPressed">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackground}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundPressed}" />
                                        <Setter Target="SecondaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushPressed}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundPressed}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="Checked">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundChecked}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundChecked}" />
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushChecked}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundChecked}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundChecked}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="CheckedFlyoutOpen">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" />
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPressed}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPressed}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="CheckedTouchPressed">
                                    <VisualState.Setters>
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" />
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPressed}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPressed}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="CheckedPrimaryPointerOver">
                                    <VisualState.Setters>
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushChecked}" />
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPointerOver}" />
                                        <Setter Target="PrimaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushCheckedPointerOver}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPointerOver}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundChecked}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundChecked}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="CheckedPrimaryPressed">
                                    <VisualState.Setters>
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushChecked}" />
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" />
                                        <Setter Target="PrimaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPressed}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundChecked}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundChecked}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="CheckedSecondaryPointerOver">
                                    <VisualState.Setters>
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushChecked}" />
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundChecked}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundChecked}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPointerOver}" />
                                        <Setter Target="SecondaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushCheckedPointerOver}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPointerOver}" />
                                    </VisualState.Setters>
                                </VisualState>

                                <VisualState x:Name="CheckedSecondaryPressed">
                                    <VisualState.Setters>
                                        <Setter Target="Border.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushChecked}" />
                                        <Setter Target="PrimaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundChecked}" />
                                        <Setter Target="PrimaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundChecked}" />
                                        <Setter Target="SecondaryBackgroundGrid.Background"
                                                Value="{ThemeResource SplitButtonBackgroundCheckedPressed}" />
                                        <Setter Target="SecondaryButton.BorderBrush"
                                                Value="{ThemeResource SplitButtonBorderBrushCheckedPressed}" />
                                        <Setter Target="SecondaryButton.Foreground"
                                                Value="{ThemeResource SplitButtonForegroundCheckedPressed}" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="SecondaryButtonPlacementStates">
                                <VisualState x:Name="SecondaryButtonRight" />

                                <VisualState x:Name="SecondaryButtonSpan">
                                    <VisualState.Setters>
                                        <Setter Target="SecondaryButton.(Grid.Column)"
                                                Value="0" />
                                        <Setter Target="SecondaryButton.(Grid.ColumnSpan)"
                                                Value="3" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="PrimaryButtonColumn"
                                              Width="*"
                                              MinWidth="{ThemeResource SplitButtonPrimaryButtonSize}" />
                            <ColumnDefinition x:Name="Separator"
                                              Width="1" />
                            <ColumnDefinition x:Name="SecondaryButtonColumn"
                                              Width="{ThemeResource SplitButtonSecondaryButtonSize}" />
                        </Grid.ColumnDefinitions>

                        <Grid x:Name="PrimaryBackgroundGrid"
                              Background="{TemplateBinding Background}" />

                        <Grid x:Name="SecondaryBackgroundGrid"
                              Background="{TemplateBinding Background}"
                              Grid.Column="2" />

                        <Grid x:Name="Border"
                              Grid.ColumnSpan="3"
                              BorderBrush="{TemplateBinding BorderBrush}"
                              BorderThickness="{TemplateBinding BorderThickness}"
                              CornerRadius="{TemplateBinding CornerRadius}" />

                        <controls:IconButton x:Name="PrimaryButton"
                                             Grid.Column="0"
                                             IconSource="{TemplateBinding IconSource}"
                                             IsCompact="{TemplateBinding IsCompact}"
                                             IsEnabled="{TemplateBinding IsPrimaryButtonEnabled}"
                                             Foreground="{TemplateBinding Foreground}"
                                             Background="{TemplateBinding Background}"
                                             BorderThickness="{TemplateBinding BorderThickness}"
                                             BorderBrush="Transparent"
                                             Content="{TemplateBinding Content}"
                                             ContentTransitions="{TemplateBinding ContentTransitions}"
                                             ContentTemplate="{TemplateBinding ContentTemplate}"
                                             Command="{TemplateBinding Command}"
                                             CommandParameter="{TemplateBinding CommandParameter}"
                                             FontFamily="{TemplateBinding FontFamily}"
                                             FontSize="{TemplateBinding FontSize}"
                                             FontWeight="{TemplateBinding FontWeight}"
                                             HorizontalAlignment="Stretch"
                                             VerticalAlignment="Stretch"
                                             HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                             VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                             Padding="{TemplateBinding Padding}"
                                             IsTabStop="False"
                                             AutomationProperties.AccessibilityView="Raw" />

                        <Button x:Name="SecondaryButton"
                                Grid.Column="2"
                                Foreground="{TemplateBinding Foreground}"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="Transparent"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                Padding="0,0,9,0"
                                IsTabStop="False"
                                AutomationProperties.AccessibilityView="Raw">
                            <Button.Content>
                                <TextBlock FontFamily="Segoe MDL2 Assets"
                                           FontSize="12"
                                           Text="&#xE70D;"
                                           VerticalAlignment="Center"
                                           HorizontalAlignment="Right"
                                           IsTextScaleFactorEnabled="False"
                                           AutomationProperties.AccessibilityView="Raw" />
                            </Button.Content>
                        </Button>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:PanedTabView2">
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Background"
                Value="#00FFFFFF" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:PanedTabView2">
                    <Grid x:Name="RootElement"
                          HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalAlignment}"
                          Background="{TemplateBinding Background}">

                        <Grid.Resources>
                            <ThemeResource x:Key="ListViewItemBackgroundSelected"
                                           ResourceKey="ApplicationPageBackgroundThemeBrush" />
                            <Style x:Key="TabListView"
                                   TargetType="ListView">
                                <Setter Property="VerticalAlignment"
                                        Value="Stretch" />
                                <Setter Property="IsTabStop"
                                        Value="False" />
                                <Setter Property="TabNavigation"
                                        Value="Once" />
                                <Setter Property="IsSwipeEnabled"
                                        Value="False" />
                                <Setter Property="SingleSelectionFollowsFocus"
                                        Value="False" />
                                <Setter Property="CanReorderItems"
                                        Value="True" />
                                <Setter Property="CanDragItems"
                                        Value="False" />
                                <Setter Property="AllowDrop"
                                        Value="True" />
                                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
                                        Value="Auto" />
                                <Setter Property="ScrollViewer.VerticalScrollBarVisibility"
                                        Value="Disabled" />
                                <Setter Property="ScrollViewer.HorizontalScrollMode"
                                        Value="Enabled" />
                                <Setter Property="ScrollViewer.IsHorizontalRailEnabled"
                                        Value="False" />
                                <Setter Property="ScrollViewer.VerticalScrollMode"
                                        Value="Disabled" />
                                <Setter Property="ScrollViewer.IsVerticalRailEnabled"
                                        Value="False" />
                                <Setter Property="ScrollViewer.ZoomMode"
                                        Value="Disabled" />
                                <Setter Property="ScrollViewer.IsDeferredScrollingEnabled"
                                        Value="False" />
                                <Setter Property="ScrollViewer.BringIntoViewOnFocusChange"
                                        Value="True" />
                                <Setter Property="ItemContainerTransitions">
                                    <Setter.Value>
                                        <TransitionCollection>
                                            <AddDeleteThemeTransition />
                                            <ContentThemeTransition />
                                            <ReorderThemeTransition />
                                            <EntranceThemeTransition IsStaggeringEnabled="False" />
                                        </TransitionCollection>
                                    </Setter.Value>
                                </Setter>

                                <Setter Property="ItemsPanel">
                                    <Setter.Value>
                                        <ItemsPanelTemplate>
                                            <ItemsStackPanel Orientation="Horizontal" />
                                        </ItemsPanelTemplate>
                                    </Setter.Value>
                                </Setter>

                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ListView">
                                            <Border BorderBrush="{TemplateBinding BorderBrush}"
                                                    Background="{TemplateBinding Background}"
                                                    BorderThickness="{TemplateBinding BorderThickness}"
                                                    CornerRadius="{TemplateBinding CornerRadius}">
                                                <ScrollViewer x:Name="ScrollViewer"
                                                              Grid.Column="1"
                                                              AutomationProperties.AccessibilityView="Raw"
                                                              BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}"
                                                              HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                                              HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
                                                              IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
                                                              IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
                                                              IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}"
                                                              IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
                                                              IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}"
                                                              TabNavigation="{TemplateBinding TabNavigation}"
                                                              VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                                                              VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
                                                              ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"
                                                              Style="{StaticResource TabScrollViewerStyle}">

                                                    <ItemsPresenter x:Name="TabsItemsPresenter"
                                                                    Padding="{TemplateBinding Padding}" />

                                                </ScrollViewer>
                                            </Border>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" MinHeight="32" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <Grid x:Name="TabHeaderGrid"
                              Background="{TemplateBinding HeaderBackground}"
                              Canvas.ZIndex="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"
                                                  x:Name="LeftHeaderColumn" />
                                <ColumnDefinition Width="Auto"
                                                  x:Name="TabHeaderColumn" />
                                <ColumnDefinition Width="*"
                                                  x:Name="RightHeaderColumn" />
                            </Grid.ColumnDefinitions>

                            <ContentPresenter x:Name="LeftHeaderPresenter"
                                              Content="{TemplateBinding LeftHeader}"
                                              ContentTemplate="{TemplateBinding LeftHeaderTemplate}"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch" />

                            <ListView x:Name="TabHeaderList"
                                      Grid.Column="1"
                                      Style="{StaticResource TabListView}"
                                      ItemsSource="{TemplateBinding TabItemsSource}"
                                      ItemTemplate="{TemplateBinding TabHeaderTemplate}"
                                      SelectionMode="Single"
                                      VerticalAlignment="Stretch"
                                      Padding="0">
                                <!-- SelectedItem="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=SelectedItem, Mode=TwoWay}"
                                SelectedIndex="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=SelectedIndex, Mode=TwoWay}"-->
                                <ListView.ItemContainerStyle>
                                    <Style TargetType="ListViewItem"
                                           BasedOn="{StaticResource DefaultListViewItemStyle}">
                                        <Setter Property="CornerRadius"
                                                Value="6,6,0,0" />
                                        <Setter Property="Padding"
                                                Value="0" />
                                        <Setter Property="Margin"
                                                Value="-4,0,-4,-3" />
                                        <Setter Property="HorizontalContentAlignment"
                                                Value="Stretch" />
                                        <Setter Property="VerticalContentAlignment"
                                                Value="Stretch" />
                                        <Setter Property="Width"
                                                Value="180" />
                                        <Setter Property="FontFamily"
                                                Value="{ThemeResource ContentControlThemeFontFamily}" />
                                        <Setter Property="FontSize"
                                                Value="{ThemeResource ControlContentThemeFontSize}" />
                                        <Setter Property="Background"
                                                Value="{ThemeResource ListViewItemBackground}" />
                                        <Setter Property="Foreground"
                                                Value="{ThemeResource ListViewItemForeground}" />
                                        <Setter Property="TabNavigation"
                                                Value="Local" />
                                        <Setter Property="IsHoldingEnabled"
                                                Value="True" />
                                        <Setter Property="AllowDrop"
                                                Value="False" />
                                        <Setter Property="UseSystemFocusVisuals"
                                                Value="{StaticResource UseSystemFocusVisuals}" />
                                        <Setter Property="FocusVisualMargin"
                                                Value="0" />
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="ListViewItem">
                                                    <ListViewItemPresenter ContentTransitions="{TemplateBinding ContentTransitions}"
                                                                           x:Name="Root"
                                                                           Control.IsTemplateFocusTarget="True"
                                                                           FocusVisualMargin="{TemplateBinding FocusVisualMargin}"
                                                                           CornerRadius="{TemplateBinding CornerRadius}"
                                                                           SelectionCheckMarkVisualEnabled="{ThemeResource ListViewItemSelectionCheckMarkVisualEnabled}"
                                                                           CheckBrush="{ThemeResource ListViewItemCheckBrush}"
                                                                           CheckBoxBrush="{ThemeResource ListViewItemCheckBoxBrush}"
                                                                           DragBackground="{ThemeResource ListViewItemDragBackground}"
                                                                           DragForeground="{ThemeResource ListViewItemDragForeground}"
                                                                           FocusBorderBrush="{ThemeResource ListViewItemFocusBorderBrush}"
                                                                           FocusSecondaryBorderBrush="{ThemeResource ListViewItemFocusSecondaryBorderBrush}"
                                                                           PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackground}"
                                                                           PointerOverBackground="{ThemeResource ListViewItemBackgroundPointerOver}"
                                                                           PointerOverForeground="{ThemeResource ListViewItemForeground}"
                                                                           SelectedBackground="{ThemeResource ApplicationPageBackgroundThemeBrush}"
                                                                           SelectedForeground="{ThemeResource ListViewItemForeground}"
                                                                           SelectedPointerOverBackground="{ThemeResource SystemControlBackgroundChromeMediumBrush}"
                                                                           PressedBackground="{ThemeResource ListViewItemBackgroundPressed}"
                                                                           SelectedPressedBackground="{ThemeResource SystemControlBackgroundChromeMediumBrush}"
                                                                           DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}"
                                                                           DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"
                                                                           ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
                                                                           HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                           VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                                           ContentMargin="{TemplateBinding Padding}"
                                                                           CheckMode="{ThemeResource ListViewItemCheckMode}"
                                                                           RevealBackground="{ThemeResource ListViewItemRevealBackground}"
                                                                           RevealBorderThickness="0"
                                                                           RevealBorderBrush="{ThemeResource ListViewItemRevealBorderBrush}">

                                                        <VisualStateManager.VisualStateGroups>
                                                            <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal" />

                                                                <VisualState x:Name="Selected" />


                                                                <VisualState x:Name="PointerOver" />


                                                                <VisualState x:Name="PointerOverSelected" />


                                                                <VisualState x:Name="PointerOverPressed" />


                                                                <VisualState x:Name="Pressed" />


                                                                <VisualState x:Name="PressedSelected" />



                                                            </VisualStateGroup>

                                                            <VisualStateGroup x:Name="DisabledStates">
                                                                <VisualState x:Name="Enabled" />

                                                                <VisualState x:Name="Disabled" />


                                                            </VisualStateGroup>

                                                        </VisualStateManager.VisualStateGroups>
                                                    </ListViewItemPresenter>

                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </ListView.ItemContainerStyle>
                            </ListView>

                            <ContentPresenter x:Name="RightHeaderPresenter"
                                              Grid.Column="2"
                                              Content="{TemplateBinding RightHeader}"
                                              ContentTemplate="{TemplateBinding RightHeaderTemplate}"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch" />
                        </Grid>

                        <ContentPresenter x:Name="BelowHeaderPresenter"
                                          Grid.Row="1"
                                          Content="{TemplateBinding TabStripContent}"
                                          ContentTemplate="{TemplateBinding TabStripContentTemplate}"
                                          HorizontalAlignment="Stretch"
                                          VerticalAlignment="Stretch"
                                          Canvas.ZIndex="1"/>

                        <winui:NavigationView x:Name="navView"
                                              Grid.Row="2"
                                              IsBackButtonVisible="Collapsed"
                                              IsBackEnabled="False"
                                              IsSettingsVisible="False"
                                              IsPaneToggleButtonVisible="False"
                                              IsPaneOpen="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=IsPaneOpen, Mode=TwoWay}"
                                              MenuItemsSource="{TemplateBinding MenuItemsSource}"
                                              MenuItemTemplateSelector="{TemplateBinding MenuItemTemplateSelector}"
                                              FooterMenuItemsSource="{TemplateBinding FooterMenuItemsSource}"
                                              PaneDisplayMode="Left"
                                              Canvas.ZIndex="0">

                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ItemsControl ItemsSource="{TemplateBinding TabItemsSource}"
                                              ItemTemplate="{TemplateBinding TabItemTemplate}"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch">
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <Grid />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                    <ItemsControl.ItemContainerStyle>
                                        <Style TargetType="ContentPresenter">
                                            <Setter Property="HorizontalContentAlignment"
                                                    Value="Stretch" />
                                            <Setter Property="VerticalContentAlignment"
                                                    Value="Stretch" />
                                        </Style>
                                    </ItemsControl.ItemContainerStyle>
                                </ItemsControl>

                                <ContentPresenter Grid.Column="1"
                                                  Width="320"
                                                  Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
                                                  Content="{TemplateBinding DetailsPane}"
                                                  HorizontalAlignment="Stretch"
                                                  VerticalAlignment="Stretch"
                                                  Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=IsDetailsPaneOpen, Mode=OneWay, Converter={StaticResource VisibleWhenTrueConverter}}" />
                            </Grid>
                        </winui:NavigationView>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
