<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:fv="using:C1.Xaml.FlexViewer"
    xmlns:c1="using:C1.Xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:uu="single line comment"
    mc:Ignorable="uu"
    >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP.FlexViewer/Themes/Common.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <SolidColorBrush x:Key="NotFoundTextBrush" Color="Red" />

    <fv:GridLengthConverter x:Key="gridLengthConverter"/>
    <fv:TopMarginConverter x:Key="topMarginConverter"/>

    <!--#region ToolMenuItemContainerStyle-->

    <Style x:Key="ToolMenuItemContainerStyle" TargetType="ListViewItem">
        <Setter Property="MinWidth" Value="{StaticResource SplitViewCompactPaneThemeLength}"/>
        <Setter Property="Height" Value="{StaticResource SplitViewCompactPaneThemeLength}"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListViewItem">
                    <ListViewItemPresenter
                        ContentTransitions="{TemplateBinding ContentTransitions}"
                        SelectionCheckMarkVisualEnabled="True"
                        CheckBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
                        CheckBoxBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
                        DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}"
                        DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}"
                        FocusBorderBrush="{ThemeResource SystemControlForegroundAltHighBrush}"
                        FocusSecondaryBorderBrush="{ThemeResource SystemControlForegroundBaseHighBrush}"
                        PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}"
                        PointerOverBackground="{ThemeResource SystemControlHighlightListLowBrush}"
                        PointerOverForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
                        SelectedBackground="{ThemeResource SystemControlHighlightListAccentLowBrush}"
                        SelectedForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
                        SelectedPointerOverBackground="{ThemeResource SystemControlHighlightListAccentMediumBrush}"
                        PressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}"
                        SelectedPressedBackground="{ThemeResource SystemControlHighlightListAccentHighBrush}"
                        DisabledOpacity="0.44"
                        DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"
                        ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        ContentMargin="{TemplateBinding Padding}"
                        CheckMode="Inline"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

    <!--#region ToolMenuItemTemplate-->

    <DataTemplate x:Key="ToolMenuItemTemplate">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="{Binding Source={StaticResource SplitViewCompactPaneThemeLength}, Converter={StaticResource gridLengthConverter}, Mode=OneWay}" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <FontIcon
                x:Name="Glyph"
                FontSize="20"
                FontFamily="{ThemeResource SymbolThemeFontFamily}"
                Glyph="{Binding Glyph}"
                VerticalAlignment="Center"
                HorizontalAlignment="Center"
                ToolTipService.ToolTip="{Binding Label}"
                />
            <TextBlock
                x:Name="Text"
                Grid.Column="1"
                Text="{Binding Label}"
                VerticalAlignment="Center"
                />
        </Grid>
    </DataTemplate>

    <!--#endregion-->

    <!--#region HamburgerButtonStyle-->

    <Style x:Key="HamburgerButtonStyle" TargetType="ToggleButton">
        <Setter Property="FontSize" Value="20" />
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
        <Setter Property="MinHeight" Value="{StaticResource SplitViewCompactPaneThemeLength}" />
        <Setter Property="MinWidth" Value="{StaticResource SplitViewCompactPaneThemeLength}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="Content" Value="&#xE700;" />
        <Setter Property="UseSystemFocusVisuals" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="layoutRoot" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Checked"/>
                                <VisualState x:Name="CheckedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter
                            x:Name="contentPresenter"
                            Content="{TemplateBinding Content}"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

    <!--#region ViewHeader Implicit Style-->

    <Style TargetType="fv:ViewHeader">
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" />
        <Setter Property="Height" Value="{StaticResource SplitViewCompactPaneThemeLength}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="fv:ViewHeader">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid x:Name="titleBarGrid">
                            <ContentPresenter Content="{TemplateBinding HeaderContent}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

    <!--#region ViewMenuStyle-->

    <Style x:Key="ViewMenuStyle" TargetType="Button" BasedOn="{StaticResource FVBaseButtonStyle}">
        <Setter Property="Padding" Value="10, 0, 10, 0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="layoutRoot" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentText" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentIcon" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentText" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentIcon" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentText" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentIcon" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

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

                        <TextBlock
                            x:Name="contentText"
                            Text="{Binding ViewButtonText, Source={StaticResource Strings}}"
                            FontWeight="SemiBold"
                            Margin="0, 0, 8, 0"
                            VerticalAlignment="Center"
                            />
                        <FontIcon
                            x:Name="contentIcon"
                            Grid.Column="1"
                            FontFamily="{ThemeResource SymbolThemeFontFamily}"
                            FontSize="16"
                            Glyph="&#xE0A1;"
                            />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Flyout">
            <Setter.Value>
                <MenuFlyout>
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiPaginated"
                        Text="{Binding PrintLayoutLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding Paginated, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiContinuous"
                        Text="{Binding ContinuousViewLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding Continuous, Mode=TwoWay}"
                        />
                    <MenuFlyoutSeparator x:Name="mfsZoomSection" />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiActualSize"
                        Text="{Binding ActualSizeLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsActualSizeZoomMode, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiPageWidth"
                        Text="{Binding PageWidthLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsPageWidthZoomMode, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiWholePage"
                        Text="{Binding WholePageLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsWholePageZoomMode, Mode=TwoWay}"
                        />
                    <MenuFlyoutSeparator x:Name="mfsRotationSection" />
                    <MenuFlyoutItem
                        x:Name="mfiRotateClockwise"
                        Text="{Binding RotateClockwiseLabel, Source={StaticResource Strings}}"
                        />
                    <MenuFlyoutItem
                        x:Name="mfiRotateCounterClockwise"
                        Text="{Binding RotateCounterClockwiseLabel, Source={StaticResource Strings}}"
                        />
                    <MenuFlyoutSeparator x:Name="mfsColumnsSection" />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiOnePage"
                        Text="{Binding OnePageLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsOnePageColumnLayout, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiFacingPages"
                        Text="{Binding FacingPagesLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding FacingPages, Mode=TwoWay}"
                        />
                    <!--<MenuFlyoutItem
                        x:Name="mfiFacingPages"
                        Text="{Binding FacingPagesLabel, Source={StaticResource Strings}}"
                        uu:CommandExtensions.Command="fv:C1FlexViewerPane.FacingPagesCommand"
                        uu:CommandExtensions.CommandTarget="{Binding}"
                        />-->
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiTwoPages"
                        Text="{Binding TwoPagesLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsTwoPageColumnsLayout, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiFourPages"
                        Text="{Binding FourPagesLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsFourPageColumnsLayout, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiEightPages"
                        Text="{Binding EightPagesLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsEightPageColumnsLayout, Mode=TwoWay}"
                        />
                    <MenuFlyoutSeparator x:Name="mfsRowsSection" />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiOneRow"
                        Text="{Binding OneRowViewLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsOnePageRowLayout, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiTwoRows"
                        Text="{Binding TwoRowsViewLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsTwoPageRowsLayout, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiThreeRows"
                        Text="{Binding ThreeRowsViewLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding IsThreePageRowsLayout, Mode=TwoWay}"
                        />
                    <MenuFlyoutSeparator x:Name="mfsWideSection" />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiWideLayout"
                        Text="{Binding WideLayoutLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding WideLayout, Mode=TwoWay}"
                        />
                </MenuFlyout>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

    <!--#region SearchButtonStyle-->

    <Style x:Key="SearchButtonStyle" TargetType="ToggleButton" BasedOn="{StaticResource FVBaseButtonStyle}">
        <Setter Property="Padding" Value="14, 0, 14, 0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="layoutRoot" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="layoutRoot" Storyboard.TargetProperty="(Grid.Background)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightListMediumBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter
                            x:Name="contentPresenter"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

    <!--#region SearchToolBarButtonStyle-->

    <Style x:Key="SearchToolBarButtonStyle" TargetType="Button" BasedOn="{StaticResource FVPushButtonStyle}">
        <Setter Property="Padding" Value="14, 0, 14, 0" />
        <!--<Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />-->
    </Style>

    <!--#endregion-->

    <!--#region SearchOptionsMenuStyle-->

    <Style x:Key="SearchOptionsMenuStyle" TargetType="Button" BasedOn="{StaticResource FVPushButtonStyle}">
        <Setter Property="Padding" Value="14, 0, 14, 0" />
        <Setter Property="Flyout">
            <Setter.Value>
                <MenuFlyout>
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiMatchWholeWord"
                        Text="{Binding MatchWholeWordLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding MatchWholeWord, Mode=TwoWay}"
                        />
                    <ToggleMenuFlyoutItem
                        x:Name="tmfiMatchCase"
                        Text="{Binding MatchCaseLabel, Source={StaticResource Strings}}"
                        uu:IsChecked="{Binding MatchCase, Mode=TwoWay}"
                        />
                </MenuFlyout>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

    <!--#region SearchToolBar Implicit Style-->

    <Style TargetType="fv:SearchToolBar">
        <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="fv:SearchToolBar">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition x:Name="rightColumn" Width="8" />
                        </Grid.ColumnDefinitions>
                        <Button
                            x:Name="optionsMenuButton"
                            Style="{StaticResource SearchOptionsMenuStyle}"
                            ToolTipService.ToolTip="{Binding SearchOptionsMenuToolTip, Source={StaticResource Strings}}"
                            VerticalAlignment="Stretch"
                            >
                            <FontIcon
                                FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                FontSize="16"
                                Glyph="&#xE0A1;"
                                />
                        </Button>
                        <AutoSuggestBox
                            x:Name="searchBox"
                            Grid.Column="1"
                            PlaceholderText="{Binding SearchPlaceholderText, Source={StaticResource Strings}}"
                            VerticalAlignment="Center"
                            />
                        <TextBlock
                            x:Name="notFoundText"
                            Grid.Column="2"
                            Text="{Binding NoResultsFoundLabel, Source={StaticResource Strings}}"
                            FontSize="16"
                            Foreground="{ThemeResource NotFoundTextBrush}"
                            VerticalAlignment="Center"
                            Padding="10, 0, 7, 2"
                            Visibility="Collapsed"
                            />
                        <Button
                            x:Name="previousButton"
                            Grid.Column="3"
                            Style="{StaticResource SearchToolBarButtonStyle}"
                            ToolTipService.ToolTip="{Binding SearchPreviousToolTip, Source={StaticResource Strings}}"
                            VerticalAlignment="Stretch"
                            HorizontalAlignment="Right"
                            Visibility="Collapsed"
                            >
                            <FontIcon
                                FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                FontSize="16"
                                FontWeight="SemiBold"
                                Glyph="&#xE09E;"
                                />
                        </Button>
                        <Button
                            x:Name="nextButton"
                            Grid.Column="4"
                            Style="{StaticResource SearchToolBarButtonStyle}"
                            ToolTipService.ToolTip="{Binding SearchNextToolTip, Source={StaticResource Strings}}"
                            VerticalAlignment="Stretch"
                            HorizontalAlignment="Right"
                            Visibility="Collapsed"
                            >
                            <FontIcon
                                FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                FontSize="16"
                                FontWeight="SemiBold"
                                Glyph="&#xE09F;"
                                />
                        </Button>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

    <!--#region C1FlexViewer Implicit Style-->

    <Style TargetType="fv:C1FlexViewer">
        <Setter Property="PageBorderBrush" Value="{StaticResource PageBorderBrush}"/>
        <Setter Property="PageAreaBackground" Value="{StaticResource PageAreaBackground}"/>
        <Setter Property="PageBackground" Value="{StaticResource PageBackground}"/>
        <Setter Property="ThumbnailPageNumBackground" Value="{StaticResource ThumbnailPageNumBackground}"/>
        <Setter Property="ThumbnailPageNumForeground" Value="{StaticResource ThumbnailPageNumForeground}"/>
        <Setter Property="ThumbnailSelectedBackground" Value="{StaticResource ThumbnailSelectedBackground}"/>
        <Setter Property="ThumbnailSelectedOverBackground" Value="{StaticResource ThumbnailSelectedOverBackground}"/>
        <Setter Property="ThumbnailOverBackground" Value="{StaticResource ThumbnailOverBackground}"/>
        <Setter Property="StatusBackground" Value="{StaticResource StatusBackground}"/>
        <Setter Property="StatusBorderBrush" Value="{StaticResource StatusBorderBrush}"/>
        <Setter Property="StatusForeground" Value="{StaticResource StatusForeground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="fv:C1FlexViewer">
                    <Grid x:Name="layoutRoot" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}">
                        <SplitView
                            x:Name="rootSplitView"
                            DisplayMode="Overlay"
                            OpenPaneLength="{TemplateBinding ToolMenuWidth}"
                            IsTabStop="False"
                            >
                            <SplitView.Pane>
                                <fv:ToolMenu
                                    x:Name="toolMenu"
                                    Margin="{Binding Source={StaticResource SplitViewCompactPaneThemeLength}, Converter={StaticResource topMarginConverter}, Mode=OneWay}"
                                    ItemContainerStyle="{StaticResource ToolMenuItemContainerStyle}"
                                    ItemTemplate="{StaticResource ToolMenuItemTemplate}"
                                    IsTabStop="False"
                                    TabIndex="3"
                                    />
                            </SplitView.Pane>
                            <SplitView.Content>
                                <Grid x:Name="contentGrid">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition x:Name="toolColumn" Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition x:Name="previewColumn" />
                                    </Grid.ColumnDefinitions>
                                    
                                    <Frame
                                        x:Name="toolFrame"
                                        Visibility="Collapsed"
                                        />
                                    
                                    <c1:C1GridSplitter
                                        x:Name="contentSplitter"
                                        Grid.Column="1"
                                        Visibility="Collapsed"
                                        ResizeDirection="Columns"
                                        ResizeBehavior="PreviousAndNext"
                                        ShowsPreview="True"
                                        />
                                    
                                    <Grid
                                        x:Name="previewHostGrid"
                                        Grid.Column="2"
                                        >
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition />
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <fv:ViewHeader x:Name="viewHeader">
                                            <fv:ViewHeader.HeaderContent>
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition />
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <Button
                                                        x:Name="goButton"
                                                        Style="{StaticResource FVPushButtonStyle}"
                                                        IsEnabled="False"
                                                        ToolTipService.ToolTip="{Binding GoButtonToolTip, Source={StaticResource Strings}}"
                                                        >
                                                        <Button.Content>
                                                            <TextBlock
                                                                x:Name="viewLabel"
                                                                Style="{ThemeResource PageTitleTextBlockStyle}"
                                                                Margin="0"
                                                                />
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel
                                                        x:Name="pageNumPanel"
                                                        Orientation="Horizontal"
                                                        Visibility="Collapsed"
                                                        >
                                                        <TextBlock
                                                            Style="{ThemeResource PageTitleTextBlockStyle}"
                                                            Text="{Binding PageNumLabel, Source={StaticResource Strings}}"
                                                            Margin="12, 0, 6, 0"
                                                            />
                                                        <TextBox
                                                            x:Name="pageNumBox"
                                                            VerticalAlignment="Center"
                                                            >
                                                            <TextBox.InputScope>
                                                                <InputScope>
                                                                    <InputScope.Names>
                                                                        <InputScopeName NameValue="Number" />
                                                                    </InputScope.Names>
                                                                </InputScope>
                                                            </TextBox.InputScope>
                                                        </TextBox>
                                                    </StackPanel>

                                                    <ContentPresenter
                                                        x:Name="topSearchPresenter"
                                                        Grid.Column="1"
                                                        >
                                                        <fv:SearchToolBar
                                                            x:Name="topSearchBar"
                                                            Visibility="Collapsed"
                                                            />
                                                    </ContentPresenter>

                                                    <Button
                                                        x:Name="viewMenuButton"
                                                        Grid.Column="2"
                                                        uu:DataContext="{Binding ElementName=fvp}"
                                                        Style="{StaticResource ViewMenuStyle}"
                                                        ToolTipService.ToolTip="{Binding ViewButtonToolTip, Source={StaticResource Strings}}"
                                                        IsEnabled="False"
                                                        />

                                                    <ToggleButton
                                                        x:Name="searchButton"
                                                        Grid.Column="3"
                                                        Style="{StaticResource SearchButtonStyle}"
                                                        ToolTipService.ToolTip="{Binding SearchButtonToolTip, Source={StaticResource Strings}}"
                                                        IsEnabled="False"
                                                        >
                                                        <FontIcon
                                                            FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                                            FontSize="16"
                                                            Glyph="&#xE11A;"
                                                            />
                                                    </ToggleButton>
                                                </Grid>
                                            </fv:ViewHeader.HeaderContent>
                                        </fv:ViewHeader>

                                        <fv:C1FlexViewerPane x:Name="fvp" Grid.Row="1" IsTabStop="False" />

                                        <fv:SearchToolBar
                                            x:Name="bottomSearchBar"
                                            Grid.Row="2"
                                            Visibility="Collapsed"
                                            />

                                    </Grid>
                                </Grid>
                            </SplitView.Content>

                        </SplitView>

                        <!-- Declared last to have it rendered above everything else, but it needs to be the first item in the tab sequence. -->
                        <ToggleButton
                            x:Name="hamburgerButton"
                            TabIndex="1"
                            Style="{StaticResource HamburgerButtonStyle}"
                            IsChecked="{Binding IsPaneOpen, ElementName=rootSplitView, Mode=TwoWay}"
                            ToolTipService.ToolTip="{Binding ToolsMenuButtonToolTip, Source={StaticResource Strings}}"
                            />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--#endregion-->

</ResourceDictionary>
