<uwp:NGApp
    xmlns:uwp="using:NittyGritty.Uwp"
    x:Class="JumpPoint.Uwp.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:JumpPoint.Uwp"
    xmlns:ngconv="using:NittyGritty.Uwp.Converters"
    xmlns:convevent="using:JumpPoint.Uwp.Converters.EventArgs"
    xmlns:helpers="using:JumpPoint.Uwp.Helpers"
    xmlns:conv="using:JumpPoint.Uwp.Converters"
           xmlns:resources="using:JumpPoint.Uwp.Resources">

    <uwp:NGApp.Resources>
        <ResourceDictionary>
            <!--Global Service Locator-->
            <helpers:ServiceLocator x:Key="Locator" x:Name="Locator" />
            
            <ResourceDictionary.MergedDictionaries>
                <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
                <ResourceDictionary Source="ms-appx:///Resources/IconSources.xaml" />
                <ResourceDictionary Source="ms-appx:///Resources/Commands.xaml" />
                <ResourceDictionary Source="ms-appx:///Resources/CustomStyles.xaml" />
                <resources:DataTemplates />
                <ResourceDictionary>
                    <!--<Color x:Key="SystemAccentColor">#1B5EBF</Color>-->
                    <SolidColorBrush x:Key="SystemAccentBrush"
                                     Color="{StaticResource SystemAccentColor}" />

                    <x:Double x:Key="NavigationViewItemOnLeftIconBoxHeight">20</x:Double>

                    <!--<AcrylicBrush x:Key="NavigationViewDefaultPaneBackground"
                                  BackgroundSource="HostBackdrop"
                                  FallbackColor="{ThemeResource SystemChromeMediumColor}"
                                  TintColor="{ThemeResource SystemChromeMediumColor}"
                                  TintOpacity=".8" />
                    <AcrylicBrush x:Key="NavigationViewExpandedPaneBackground"
                                  BackgroundSource="HostBackdrop"
                                  FallbackColor="{ThemeResource SystemChromeMediumColor}"
                                  TintColor="{ThemeResource SystemChromeMediumColor}"
                                  TintOpacity=".8" />-->
                    <Thickness x:Key="FlyoutContentThemePadding">0,0,0,0</Thickness>

                    <Style TargetType="Button"
                           x:Key="TitleBarButton">
                        <Setter Property="Background"
                                Value="Transparent" />
                        <Setter Property="BorderThickness"
                                Value="0" />
                        <Setter Property="AllowFocusOnInteraction"
                                Value="False" />
                        <!--<Setter Property="Padding"
                                Value="12,4" />-->
                        <Setter Property="VerticalAlignment"
                                Value="Stretch" />
                        <Setter Property="MinWidth"
                                Value="{ThemeResource NavigationViewCompactPaneLength}" />
                        <Setter Property="FontSize"
                                Value="14" />
                    </Style>

                    <Style TargetType="Button"
                           x:Key="StatusBarButton">
                        <Setter Property="Background"
                                Value="Transparent" />
                        <Setter Property="MinWidth"
                                Value="{ThemeResource NavigationViewCompactPaneLength}" />
                        <Setter Property="BorderThickness"
                                Value="0" />
                        <Setter Property="AllowFocusOnInteraction"
                                Value="False" />
                        <Setter Property="Padding"
                                Value="12,4" />
                        <Setter Property="VerticalAlignment"
                                Value="Stretch" />
                        <Setter Property="FontSize"
                                Value="14" />
                        <Setter Property="Foreground"
                                Value="White" />
                    </Style>

                    <Style TargetType="PivotHeaderItem">
                        <Setter Property="Height" Value="36" />
                    </Style>

                    <Style TargetType="ToggleSwitch">
                        <Setter Property="Foreground"
                                Value="{ThemeResource ToggleSwitchContentForeground}" />
                        <Setter Property="HorizontalAlignment"
                                Value="Left" />
                        <Setter Property="VerticalAlignment"
                                Value="Center" />
                        <Setter Property="HorizontalContentAlignment"
                                Value="Left" />
                        <Setter Property="FontFamily"
                                Value="{ThemeResource ContentControlThemeFontFamily}" />
                        <Setter Property="FontSize"
                                Value="{ThemeResource ControlContentThemeFontSize}" />
                        <Setter Property="ManipulationMode"
                                Value="System,TranslateX" />
                        <Setter Property="UseSystemFocusVisuals"
                                Value="{StaticResource UseSystemFocusVisuals}" />
                        <Setter Property="FocusVisualMargin"
                                Value="-7,-3,-7,-3" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ToggleSwitch">
                                    <Grid Background="{TemplateBinding Background}"
                                          BorderBrush="{TemplateBinding BorderBrush}"
                                          BorderThickness="{TemplateBinding BorderThickness}"
                                          CornerRadius="{TemplateBinding CornerRadius}">

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

                                                <VisualState x:Name="PointerOver">

                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                       Storyboard.TargetProperty="Stroke">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchFillOffPointerOver}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchKnobFillOffPointerOver}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchKnobFillOnPointerOver}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchFillOnPointerOver}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                       Storyboard.TargetProperty="Stroke">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchStrokeOnPointerOver}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid"
                                                                                       Storyboard.TargetProperty="Background">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>

                                                <VisualState x:Name="Pressed">

                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                       Storyboard.TargetProperty="Stroke">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchStrokeOffPressed}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchFillOffPressed}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchFillOnPressed}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                       Storyboard.TargetProperty="Stroke">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchStrokeOnPressed}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchKnobFillOffPressed}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchKnobFillOnPressed}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid"
                                                                                       Storyboard.TargetProperty="Background">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>

                                                <VisualState x:Name="Disabled">

                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter"
                                                                                       Storyboard.TargetProperty="Foreground">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchHeaderForegroundDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter"
                                                                                       Storyboard.TargetProperty="Foreground">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter"
                                                                                       Storyboard.TargetProperty="Foreground">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                       Storyboard.TargetProperty="Stroke">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchStrokeOffDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchFillOffDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchFillOnDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                       Storyboard.TargetProperty="Stroke">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchStrokeOnDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchKnobFillOffDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                       Storyboard.TargetProperty="Fill">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchKnobFillOnDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid"
                                                                                       Storyboard.TargetProperty="Background">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>

                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="ToggleStates">

                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition x:Name="DraggingToOnTransition"
                                                                      From="Dragging"
                                                                      To="On"
                                                                      GeneratedDuration="0">

                                                        <Storyboard>
                                                            <RepositionThemeAnimation TargetName="SwitchKnob"
                                                                                      FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}" />
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="1" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="0" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="1" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="0" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualTransition>
                                                    <VisualTransition x:Name="OnToDraggingTransition"
                                                                      From="On"
                                                                      To="Dragging"
                                                                      GeneratedDuration="0">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="1" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="1" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="0" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualTransition>
                                                    <VisualTransition x:Name="DraggingToOffTransition"
                                                                      From="Dragging"
                                                                      To="Off"
                                                                      GeneratedDuration="0">

                                                        <Storyboard>
                                                            <RepositionThemeAnimation TargetName="SwitchKnob"
                                                                                      FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}" />
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="0" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="0" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="1" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualTransition>
                                                    <VisualTransition x:Name="OnToOffTransition"
                                                                      From="On"
                                                                      To="Off"
                                                                      GeneratedDuration="0">

                                                        <Storyboard>
                                                            <RepositionThemeAnimation TargetName="SwitchKnob"
                                                                                      FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOnToOffOffset}" />
                                                        </Storyboard>
                                                    </VisualTransition>
                                                    <VisualTransition x:Name="OffToOnTransition"
                                                                      From="Off"
                                                                      To="On"
                                                                      GeneratedDuration="0">

                                                        <Storyboard>
                                                            <RepositionThemeAnimation TargetName="SwitchKnob"
                                                                                      FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}" />
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="1" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="0" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="1" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                           Storyboard.TargetProperty="Opacity">
                                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                                        Value="0" />
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualTransition>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="Dragging" />
                                                <VisualState x:Name="Off" />
                                                <VisualState x:Name="On">

                                                    <Storyboard>
                                                        <DoubleAnimation Storyboard.TargetName="KnobTranslateTransform"
                                                                         Storyboard.TargetProperty="X"
                                                                         To="20"
                                                                         Duration="0" />
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                                       Storyboard.TargetProperty="Opacity">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="1" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                                       Storyboard.TargetProperty="Opacity">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="0" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                                       Storyboard.TargetProperty="Opacity">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="1" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                                       Storyboard.TargetProperty="Opacity">
                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                    Value="0" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>

                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="ContentStates">
                                                <VisualState x:Name="OffContent">

                                                    <Storyboard>
                                                        <DoubleAnimation Storyboard.TargetName="OffContentPresenter"
                                                                         Storyboard.TargetProperty="Opacity"
                                                                         To="1"
                                                                         Duration="0" />
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"
                                                                                       Storyboard.TargetName="OffContentPresenter">
                                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                                <DiscreteObjectKeyFrame.Value>
                                                                    <x:Boolean>True</x:Boolean>
                                                                </DiscreteObjectKeyFrame.Value>
                                                            </DiscreteObjectKeyFrame>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="OnContent">

                                                    <Storyboard>
                                                        <DoubleAnimation Storyboard.TargetName="OnContentPresenter"
                                                                         Storyboard.TargetProperty="Opacity"
                                                                         To="1"
                                                                         Duration="0" />
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible"
                                                                                       Storyboard.TargetName="OnContentPresenter">
                                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                                <DiscreteObjectKeyFrame.Value>
                                                                    <x:Boolean>True</x:Boolean>
                                                                </DiscreteObjectKeyFrame.Value>
                                                            </DiscreteObjectKeyFrame>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>

                                            </VisualStateGroup>

                                        </VisualStateManager.VisualStateGroups>

                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>

                                        <ContentPresenter x:Name="HeaderContentPresenter"
                                                          x:DeferLoadStrategy="Lazy"
                                                          Grid.Row="0"
                                                          Content="{TemplateBinding Header}"
                                                          ContentTemplate="{TemplateBinding HeaderTemplate}"
                                                          Foreground="{ThemeResource ToggleSwitchHeaderForeground}"
                                                          IsHitTestVisible="False"
                                                          Margin="{ThemeResource ToggleSwitchTopHeaderMargin}"
                                                          TextWrapping="Wrap"
                                                          VerticalAlignment="Top"
                                                          Visibility="Collapsed"
                                                          AutomationProperties.AccessibilityView="Raw" />
                                        <Grid Grid.Row="1"
                                              MinWidth="0"
                                              HorizontalAlignment="Left"
                                              VerticalAlignment="Top">

                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="{ThemeResource ToggleSwitchPreContentMargin}" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="{ThemeResource ToggleSwitchPostContentMargin}" />
                                            </Grid.RowDefinitions>

                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="12"
                                                                  MaxWidth="12" />
                                                <ColumnDefinition Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <Grid x:Name="SwitchAreaGrid"
                                                  Grid.RowSpan="3"
                                                  Grid.ColumnSpan="3"
                                                  Margin="0,5"
                                                  Control.IsTemplateFocusTarget="True"
                                                  Background="{ThemeResource ToggleSwitchContainerBackground}" />
                                            <ContentPresenter x:Name="OffContentPresenter"
                                                              Grid.RowSpan="3"
                                                              Grid.Column="2"
                                                              Opacity="0"
                                                              Foreground="{TemplateBinding Foreground}"
                                                              IsHitTestVisible="False"
                                                              Content="{TemplateBinding OffContent}"
                                                              ContentTemplate="{TemplateBinding OffContentTemplate}"
                                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                              AutomationProperties.AccessibilityView="Raw" />
                                            <ContentPresenter x:Name="OnContentPresenter"
                                                              Grid.RowSpan="3"
                                                              Grid.Column="2"
                                                              Opacity="0"
                                                              Foreground="{TemplateBinding Foreground}"
                                                              IsHitTestVisible="False"
                                                              Content="{TemplateBinding OnContent}"
                                                              ContentTemplate="{TemplateBinding OnContentTemplate}"
                                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                              AutomationProperties.AccessibilityView="Raw" />
                                            <Rectangle x:Name="OuterBorder"
                                                       Grid.Row="1"
                                                       Height="20"
                                                       Width="40"
                                                       RadiusX="10"
                                                       RadiusY="10"
                                                       Fill="{ThemeResource ToggleSwitchFillOff}"
                                                       Stroke="{ThemeResource ToggleSwitchStrokeOff}"
                                                       StrokeThickness="{ThemeResource ToggleSwitchOuterBorderStrokeThickness}" />
                                            <Rectangle x:Name="SwitchKnobBounds"
                                                       Grid.Row="1"
                                                       Height="20"
                                                       Width="40"
                                                       RadiusX="10"
                                                       RadiusY="10"
                                                       Fill="{ThemeResource ToggleSwitchFillOn}"
                                                       Stroke="{ThemeResource ToggleSwitchStrokeOn}"
                                                       StrokeThickness="{ThemeResource ToggleSwitchOnStrokeThickness}"
                                                       Opacity="0" />
                                            <Grid x:Name="SwitchKnob"
                                                  Grid.Row="1"
                                                  HorizontalAlignment="Left"
                                                  Width="20"
                                                  Height="20">
                                                <Ellipse x:Name="SwitchKnobOn"
                                                         Fill="{ThemeResource ToggleSwitchKnobFillOn}"
                                                         Width="10"
                                                         Height="10"
                                                         Opacity="0" />
                                                <Ellipse x:Name="SwitchKnobOff"
                                                         Fill="{ThemeResource ToggleSwitchKnobFillOff}"
                                                         Width="10"
                                                         Height="10" />
                                                <Grid.RenderTransform>
                                                    <TranslateTransform x:Name="KnobTranslateTransform" />
                                                </Grid.RenderTransform>
                                            </Grid>
                                            <Thumb x:Name="SwitchThumb"
                                                   AutomationProperties.AccessibilityView="Raw"
                                                   Grid.RowSpan="3"
                                                   Grid.ColumnSpan="3">
                                                <Thumb.Template>
                                                    <ControlTemplate TargetType="Thumb">
                                                        <Rectangle Fill="Transparent" />
                                                    </ControlTemplate>
                                                </Thumb.Template>
                                            </Thumb>

                                        </Grid>

                                    </Grid>

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

                    <Thickness x:Key="PivotNavButtonMargin">0,0,0,0</Thickness>

                    <!-- Default style for Windows.UI.Xaml.Controls.AppBarSeparator -->
                    <Style TargetType="AppBarSeparator">
                        <Setter Property="Foreground" Value="{ThemeResource AppBarSeparatorForeground}" />
                        <Setter Property="IsTabStop" Value="False" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="AppBarSeparator">
                                    <Rectangle x:Name="SeparatorRectangle"
                                               Width="1"
                                               Height="18"
                                               Fill="{TemplateBinding Foreground}"
                                               Margin="4"
                                               VerticalAlignment="Center">

                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="ApplicationViewStates">
                                                <!-- FullSize is used when we are in landscape or filled mode -->
                                                <VisualState x:Name="FullSize" />
                                                <!-- Compact is used when we are in portrait or snapped mode -->
                                                <VisualState x:Name="Compact" />
                                                <VisualState x:Name="Overflow">

                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorRectangle" Storyboard.TargetProperty="Width">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="NaN" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorRectangle" Storyboard.TargetProperty="HorizontalAlignment">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Stretch" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorRectangle" Storyboard.TargetProperty="Height">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorRectangle" Storyboard.TargetProperty="Margin">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="4" />
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>

                                            </VisualStateGroup>

                                        </VisualStateManager.VisualStateGroups>
                                    </Rectangle>

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



                </ResourceDictionary>
                <ResourceDictionary>
                    <ResourceDictionary.ThemeDictionaries>
                        <ResourceDictionary x:Key="Light">
                            <AcrylicBrush x:Key="TitleBarBackground"
                                          BackgroundSource="HostBackdrop"
                                          FallbackColor="{ThemeResource SystemAccentColorLight2}"
                                          TintColor="{ThemeResource SystemAccentColorLight2}"
                                          TintOpacity=".8" />
                            <SolidColorBrush x:Key="BorderPlateBackground"
                                             Color="#1F000000" />
                        </ResourceDictionary>
                        <ResourceDictionary x:Key="Dark">
                            <!--<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush"
                                             Color="#121212" />-->
                            <AcrylicBrush x:Key="TitleBarBackground"
                                          BackgroundSource="HostBackdrop"
                                          FallbackColor="{ThemeResource SystemAccentColorDark2}"
                                          TintColor="{ThemeResource SystemAccentColorDark2}"
                                          TintOpacity=".8" />
                            <SolidColorBrush x:Key="BorderPlateBackground"
                                             Color="#1FFFFFFF" />
                        </ResourceDictionary>
                    </ResourceDictionary.ThemeDictionaries>
                </ResourceDictionary>
                <ResourceDictionary>
                    <ngconv:ColorBrushConverter x:Key="ColorBrushConverter" />
                    <ngconv:ChainConverter x:Key="DrawingColorBrushConverter">
                        <ngconv:DrawingColorConverter />
                        <ngconv:ColorBrushConverter />
                    </ngconv:ChainConverter>
                    <ngconv:ChainConverter x:Key="HexBrushConverter">
                        <conv:HexColorConverter />
                        <ngconv:DrawingColorConverter />
                        <ngconv:ColorBrushConverter />
                    </ngconv:ChainConverter>
                    <ngconv:NegateBooleanConverter x:Key="NegateBooleanConverter" />
                    <ngconv:StringEmptyConverter x:Key="StringEmptyConverter" />
                    <ngconv:StringFormatConverter x:Key="StringFormatConverter" />
                    <ngconv:StringVisibilityConverter x:Key="StringVisibilityConverter" />
                    <ngconv:ChainConverter x:Key="ReverseStringVisibilityConverter">
                        <ngconv:StringVisibilityConverter />
                        <ngconv:ReverseVisibilityConverter />
                    </ngconv:ChainConverter>
                    <ngconv:ChangeTypeConverter x:Key="ChangeTypeConverter" />
                    <ngconv:IsNullConverter x:Key="IsNullConverter" />
                    <ngconv:IsEqualConverter x:Key="IsZeroConverter" />
                    <ngconv:ReverseVisibilityConverter x:Key="ReverseVisibilityConverter" />
                    <ngconv:ChainConverter x:Key="VisibleWhenZeroConverter">
                        <ngconv:IsEqualConverter />
                        <ngconv:BooleanValueConverter>
                            <ngconv:BooleanValueConverter.TrueValue>
                                <Visibility>Visible</Visibility>
                            </ngconv:BooleanValueConverter.TrueValue>
                            <ngconv:BooleanValueConverter.FalseValue>
                                <Visibility>Collapsed</Visibility>
                            </ngconv:BooleanValueConverter.FalseValue>
                        </ngconv:BooleanValueConverter>
                    </ngconv:ChainConverter>
                    <ngconv:ChainConverter x:Key="CollapsedWhenZeroConverter">
                        <ngconv:IsEqualConverter />
                        <ngconv:BooleanValueConverter>
                            <ngconv:BooleanValueConverter.TrueValue>
                                <Visibility>Collapsed</Visibility>
                            </ngconv:BooleanValueConverter.TrueValue>
                            <ngconv:BooleanValueConverter.FalseValue>
                                <Visibility>Visible</Visibility>
                            </ngconv:BooleanValueConverter.FalseValue>
                        </ngconv:BooleanValueConverter>
                    </ngconv:ChainConverter>
                    <ngconv:ChainConverter x:Key="VisibleWhenMoreThanZeroConverter">
                        <ngconv:IsMoreThanConverter />
                        <ngconv:BooleanValueConverter>
                            <ngconv:BooleanValueConverter.TrueValue>
                                <Visibility>Visible</Visibility>
                            </ngconv:BooleanValueConverter.TrueValue>
                            <ngconv:BooleanValueConverter.FalseValue>
                                <Visibility>Collapsed</Visibility>
                            </ngconv:BooleanValueConverter.FalseValue>
                        </ngconv:BooleanValueConverter>
                    </ngconv:ChainConverter>
                    <ngconv:ValueWhenConverter x:Key="CollapsedWhenNullConverter" When="{x:Null}">
                        <ngconv:ValueWhenConverter.Value>
                            <Visibility>Collapsed</Visibility>
                        </ngconv:ValueWhenConverter.Value>
                        <ngconv:ValueWhenConverter.Otherwise>
                            <Visibility>Visible</Visibility>
                        </ngconv:ValueWhenConverter.Otherwise>
                    </ngconv:ValueWhenConverter>
                    <ngconv:ValueWhenConverter x:Key="VisibleWhenNullConverter"
                                               When="{x:Null}">
                        <ngconv:ValueWhenConverter.Value>
                            <Visibility>Visible</Visibility>
                        </ngconv:ValueWhenConverter.Value>
                        <ngconv:ValueWhenConverter.Otherwise>
                            <Visibility>Collapsed</Visibility>
                        </ngconv:ValueWhenConverter.Otherwise>
                    </ngconv:ValueWhenConverter>
                    <ngconv:NullValueConverter x:Key="ZeroWhenNullConverter">
                        <ngconv:NullValueConverter.Value>
                            <x:Double>0</x:Double>
                        </ngconv:NullValueConverter.Value>
                    </ngconv:NullValueConverter>
                    <ngconv:NullValueConverter x:Key="NegativeOneWhenNullConverter">
                        <ngconv:NullValueConverter.Value>
                            <x:Double>-1</x:Double>
                        </ngconv:NullValueConverter.Value>
                    </ngconv:NullValueConverter>

                    <ngconv:BooleanValueConverter x:Key="VisibleWhenTrueConverter">
                        <ngconv:BooleanValueConverter.TrueValue>
                            <Visibility>Visible</Visibility>
                        </ngconv:BooleanValueConverter.TrueValue>
                        <ngconv:BooleanValueConverter.FalseValue>
                            <Visibility>Collapsed</Visibility>
                        </ngconv:BooleanValueConverter.FalseValue>
                    </ngconv:BooleanValueConverter>
                    <ngconv:BooleanValueConverter x:Key="VisibleWhenFalseConverter">
                        <ngconv:BooleanValueConverter.TrueValue>
                            <Visibility>Collapsed</Visibility>
                        </ngconv:BooleanValueConverter.TrueValue>
                        <ngconv:BooleanValueConverter.FalseValue>
                            <Visibility>Visible</Visibility>
                        </ngconv:BooleanValueConverter.FalseValue>
                    </ngconv:BooleanValueConverter>
                    <ngconv:BooleanValueConverter x:Key="MultipleWhenTrueConverter">
                        <ngconv:BooleanValueConverter.TrueValue>
                            <ListViewSelectionMode>Multiple</ListViewSelectionMode>
                        </ngconv:BooleanValueConverter.TrueValue>
                        <ngconv:BooleanValueConverter.FalseValue>
                            <ListViewSelectionMode>Extended</ListViewSelectionMode>
                        </ngconv:BooleanValueConverter.FalseValue>
                    </ngconv:BooleanValueConverter>
                    <ngconv:ChainConverter x:Key="CollapsedWhenRegularFolderConverter">
                        <conv:IsRegularFolderTypeConverter />
                        <ngconv:BooleanValueConverter>
                            <ngconv:BooleanValueConverter.TrueValue>
                                <Visibility>Collapsed</Visibility>
                            </ngconv:BooleanValueConverter.TrueValue>
                            <ngconv:BooleanValueConverter.FalseValue>
                                <Visibility>Visible</Visibility>
                            </ngconv:BooleanValueConverter.FalseValue>
                        </ngconv:BooleanValueConverter>
                    </ngconv:ChainConverter>
                    <ngconv:ChainConverter x:Key="VisibleWhenRegularFolderConverter">
                        <conv:IsRegularFolderTypeConverter />
                        <ngconv:BooleanValueConverter>
                            <ngconv:BooleanValueConverter.TrueValue>
                                <Visibility>Visible</Visibility>
                            </ngconv:BooleanValueConverter.TrueValue>
                            <ngconv:BooleanValueConverter.FalseValue>
                                <Visibility>Collapsed</Visibility>
                            </ngconv:BooleanValueConverter.FalseValue>
                        </ngconv:BooleanValueConverter>
                    </ngconv:ChainConverter>

                    <convevent:ItemClickEventArgsConverter x:Key="ItemClickEventArgsConverter" />
                    <convevent:ItemDoubleClickEventArgsConverter x:Key="ItemDoubleClickEventArgsConverter" />
                    <conv:NavigationViewItemInvokedEventArgsConverter x:Key="NavigationViewItemInvokedEventArgsConverter" />
                    <conv:AppThemeConverter x:Key="AppThemeConverter" />
                    <conv:UriOrStreamToBitmapImageConverter x:Key="AppLinkDetailsLogoConverter"
                                                            Height="24" />
                    <conv:UriOrStreamToBitmapImageConverter x:Key="AppLinkGridTilesLogoConverter"
                                                            Height="58" />
                    <conv:BitmapImageConverter x:Key="AppLinkLogoConverter" />
                    <conv:HumanizerConverter x:Key="HumanizerConverter" />
                    <conv:ByteSizeConverter x:Key="ByteSizeConverter" />
                    <conv:ItemIconConverter x:Key="ItemIconConverter" />
                    <conv:NullableDateTimeOffsetToLocalConverter x:Key="NullableDateTimeOffsetToLocalConverter" />
                    <conv:NullableUlongToDoubleConverter x:Key="NullableUlongToDoubleConverter" />
                    <conv:FontFamilyConverter x:Key="FontFamilyConverter" />
                    <conv:HiddenOpacityConverter x:Key="HiddenOpacityConverter" />
                    <conv:QuantityHumanizerConverter x:Key="QuantityHumanizerConverter" />
                    <conv:ReverseStackConverter x:Key="ReverseStackConverter" />
                </ResourceDictionary>

            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </uwp:NGApp.Resources>
</uwp:NGApp>
