<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Default">
            <!-- Default theme resources -->
            <x:Double x:Key="ReaderAppBarButtonPointerOverStroke">0</x:Double>
            <SolidColorBrush x:Key="ReaderAppBarButtonForegroundBrush" Color="White"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonBackgroundBrush" Color="#FF111111"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonAccentBrush" Color="#FFD24726"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonAccentPointerOverBrush" Color="#FFDD735A"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonPointerOverBrush" Color="#3DFFFFFF"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonPointerOverFillBrush" Color="White"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonLightPointerOverBrush" Color="#FFA7A7A7"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonCheckedFillBrush" Color="White"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonDisabledBrush" Color="#7CFFFFFF" />
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrast">
            <!-- High Contrast theme resources -->
            <x:Double x:Key="ReaderAppBarButtonPointerOverStroke">2.25</x:Double>
            <SolidColorBrush x:Key="ReaderAppBarButtonForegroundBrush" Color="{StaticResource SystemColorButtonTextColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonBackgroundBrush" Color="{StaticResource SystemColorButtonFaceColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonAccentBrush" Color="{StaticResource SystemColorButtonTextColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonAccentPointerOverBrush" Color="{StaticResource SystemColorHighlightColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonPointerOverBrush" Color="{StaticResource SystemColorHighlightColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonPointerOverFillBrush" Color="{StaticResource SystemColorHighlightTextColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonLightPointerOverBrush" Color="{StaticResource SystemColorHighlightColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonCheckedFillBrush" Color="{StaticResource SystemColorButtonFaceColor}"/>
            <SolidColorBrush x:Key="ReaderAppBarButtonDisabledBrush" Color="{StaticResource SystemColorGrayTextColor}"/>
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <!-- App bar button generic -->
    <Style TargetType="Button" x:Name="ReaderAppBarButtonStyle">
        <Setter Property="Foreground" Value="{StaticResource ReaderAppBarButtonForegroundBrush}"/>
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="RootGrid" MinHeight="64" Width="100" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CircleBase" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonPointerOverBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconShape" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonPointerOverFillBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CircleBase" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconShape" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ApplicationViewStates">
                              <VisualState x:Name="FullSize" />
                              <VisualState x:Name="Compact">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                  </ObjectAnimationUsingKeyFrames>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="0,12,0,0" VerticalAlignment="Top" Height="40" Width="40" HorizontalAlignment="Center">
                            <Ellipse x:Name="CircleBase" StrokeThickness="2.25" Width="40" Height="40" Stroke="{StaticResource ReaderAppBarButtonForegroundBrush}" Fill="Transparent"/>
                            <Path FlowDirection="LeftToRight" x:Name="IconShape" Fill="{StaticResource ReaderAppBarButtonForegroundBrush}" Data="{TemplateBinding Content}" Height="{TemplateBinding MinHeight}" Width="{TemplateBinding MinWidth}" UseLayoutRounding="False"/>
                        </Grid>
                      <Rectangle x:Name="FocusVisualWhite" Stroke="White" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="1.5" Margin="0,0,0,0"/>
                      <Rectangle x:Name="FocusVisualBlack" Stroke="Black" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="0.5" Margin="0,0,0,0"/>
                      <TextBlock x:Name="ContentPresenter" Text="{TemplateBinding Tag}" TextAlignment="Center" TextWrapping="Wrap" MaxHeight="37" Foreground="{StaticResource ReaderAppBarButtonForegroundBrush}" x:Uid="AppBar" MaxWidth="88" Margin="0, 57, 0, 11" HorizontalAlignment="Center" VerticalAlignment="Top"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- App bar radio button, used for layout options -->
    <Style TargetType="RadioButton" x:Name="ReaderAppBarRadioButtonStyle">
        <Setter Property="Foreground" Value="{StaticResource ReaderAppBarButtonForegroundBrush}" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RadioButton">
                    <Grid x:Name="RootGrid" MinHeight="64" Width="100" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HoverCircle" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalIcon" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonPointerOverFillBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalCircle"
                                                                      Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalIcon"
                                                                      Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="CheckedCircle" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="NormalCircle" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="CheckedIcon" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="NormalIcon" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                                <VisualState x:Name="Indeterminate" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ApplicationViewStates">
                              <VisualState x:Name="FullSize" />
                              <VisualState x:Name="Compact">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                  </ObjectAnimationUsingKeyFrames>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="FocusVisualWhite" Stroke="White" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="1.5" Margin="0,0,0,0"/>
                        <Rectangle x:Name="FocusVisualBlack" Stroke="Black" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="0.5" Margin="0,0,0,0"/>
                        <TextBlock x:Name="ContentPresenter" Text="{TemplateBinding Tag}" TextAlignment="Center" TextWrapping="Wrap" MaxHeight="37" Foreground="{StaticResource ReaderAppBarButtonForegroundBrush}" x:Uid="AppBar" MaxWidth="88" Margin="0, 57, 0, 11" HorizontalAlignment="Center" VerticalAlignment="Top"/>
                        <Grid Margin="0,12,0,0" Height="40" Width="40" VerticalAlignment="Top" HorizontalAlignment="Center">
                            <Ellipse x:Name="HoverCircle" Fill="{StaticResource ReaderAppBarButtonPointerOverBrush}" Width="40" Height="40" Opacity="0"/>
                            <Ellipse x:Name="CheckedCircle" Fill="{StaticResource ReaderAppBarButtonAccentBrush}" Width="40" Height="40" Opacity="0"/>
                            <Ellipse x:Name="NormalCircle" Fill="Transparent" Stroke="{StaticResource ReaderAppBarButtonForegroundBrush}" Opacity="1" StrokeThickness="2.25" Width="40" Height="40"/>
                            <Path FlowDirection="LeftToRight" x:Name="CheckedIcon" Opacity="0" Fill="{StaticResource ReaderAppBarButtonCheckedFillBrush}" Data="{TemplateBinding Content}" Height="{TemplateBinding MinHeight}" Width="{TemplateBinding MinWidth}"/>
                            <Path FlowDirection="LeftToRight" x:Name="NormalIcon" Fill="{StaticResource ReaderAppBarButtonForegroundBrush}" Data="{TemplateBinding Content}" Height="{TemplateBinding MinHeight}" Width="{TemplateBinding MinWidth}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- App bar toggle button, used for Cover page, More, Results -->
    <Style TargetType="ToggleButton" x:Name="ReaderAppBarToggleButtonStyle">
        <Setter Property="Padding" Value="0" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="RootGrid" MinHeight="64" Width="100" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconBase" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonPointerOverBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonPointerOverFillBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconBase" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="IconBase" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="IconBaseChecked" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="IconChecked" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPointerOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="IconBaseChecked" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="IconBase" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="IconChecked" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="IconBasePointerOver" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconChecked" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonPointerOverFillBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconBase" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ReaderAppBarButtonBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ApplicationViewStates">
                              <VisualState x:Name="FullSize" />
                              <VisualState x:Name="Compact">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                  </ObjectAnimationUsingKeyFrames>
																	<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="FocusVisualWhite" Stroke="White" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="1.5" Margin="0,0,0,0"/>
                        <Rectangle x:Name="FocusVisualBlack" Stroke="Black" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="0.5" Margin="0,0,0,0"/>
                        <Grid Margin="0,12,0,0" Height="40" Width="40" VerticalAlignment="Top" HorizontalAlignment="Center">
                            <Ellipse x:Name="IconBase" Fill="Transparent" Stroke="{StaticResource ReaderAppBarButtonForegroundBrush}" Opacity="1" StrokeThickness="2.25" Width="40" Height="40"/>
                            <Ellipse x:Name="IconBaseChecked" Fill="{TemplateBinding Background}" Opacity="0" Width="40" Height="40"/>
                            <Ellipse x:Name="IconBasePointerOver" StrokeThickness="{StaticResource ReaderAppBarButtonPointerOverStroke}" Stroke="{StaticResource ReaderAppBarButtonForegroundBrush}" Fill="{TemplateBinding BorderBrush}" Opacity="0" Width="40" Height="40"/>
                            <Path FlowDirection="LeftToRight" x:Name="Icon" Fill="{StaticResource ReaderAppBarButtonForegroundBrush}" Data="{TemplateBinding Content}" Height="{TemplateBinding MinHeight}" Width="{TemplateBinding MinWidth}"/>
                            <Path FlowDirection="LeftToRight" x:Name="IconChecked" Fill="{TemplateBinding Foreground}" Opacity="0" Data="{TemplateBinding Content}" Height="{TemplateBinding MinHeight}" Width="{TemplateBinding MinWidth}"/>
                        </Grid>
                        <TextBlock x:Name="ContentPresenter" Text="{TemplateBinding Tag}" TextAlignment="Center" TextWrapping="Wrap" MaxHeight="37" Foreground="{StaticResource ReaderAppBarButtonForegroundBrush}" x:Uid="AppBar" MaxWidth="88" Margin="0, 57, 0, 11" HorizontalAlignment="Center" VerticalAlignment="Top"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>