<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:telerikControlsRTBUIStatusBar="clr-namespace:Telerik.Windows.Controls.RichTextBoxUI.StatusBar;assembly=Telerik.Windows.Controls.RichTextBoxUI"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:appearance="clr-namespace:Office2016InspiredApplication.Appearance">
    
    <Style x:Key="PageMarginStyle" TargetType="Rectangle">
        <Setter Property="Fill" Value="{appearance:Office2016Resource Resource=PageMarginBackground}"/>
        <Setter Property="Stroke" Value="{appearance:Office2016Resource Resource=PageMarginBackground}"/>
        <Setter Property="StrokeThickness" Value="1"/>
    </Style>

    <Style x:Key="Office2016DocumentRulerBaseStyle" TargetType="telerik:DocumentRulerBase" BasedOn="{StaticResource DocumentRulerBaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:DocumentRulerBase">
                    <Grid x:Name="PART_LayoutRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="24"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="24"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <ContentPresenter Grid.Column="1" Grid.Row="1"/>
                        <Canvas x:Name="PART_HorizontalCanvas"
                                Grid.Column="1"
                                Background="{appearance:Office2016Resource Resource=DocumentBackground}"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch">
                            <Grid x:Name="PART_HorizontalRulerContainer" Height="19" Margin="0 5">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="5"/>
                                </Grid.RowDefinitions>
                                <Canvas>
                                    <Rectangle x:Name="PART_LeftMarginRectangle" Style="{StaticResource PageMarginStyle}" Height="14"/>
                                    <Rectangle x:Name="PART_PageHorizontalRectangle"
                                            Fill="{appearance:Office2016Resource Resource=PageRectangleFill}"
                                            Canvas.Left="0"
                                            Canvas.Top="0"
                                            Height="14"
                                            Stroke="{appearance:Office2016Resource Resource=PageMarginBackground}"
                                            StrokeThickness="1"/>
                                    <Rectangle x:Name="PART_RightMarginRectangle" Style="{StaticResource PageMarginStyle}" Height="14"/>
                                </Canvas>
                                <Canvas x:Name="PART_HorizontalMarkersContainer"/>
                                <Canvas x:Name="PART_HorizontalThumbBackgroundsContainer"/>
                                <Canvas x:Name="PART_HorizontalThumbsContainer" Canvas.ZIndex="10">
                                    <telerik:RulerThumb x:Name="PART_ParagraphFirstLineIndent"
                                            RulerThumbType="FirstLineIndent"
                                            Canvas.ZIndex="10"
                                            ToolTipText="First Line Indent"
                                            Style="{StaticResource FirstLineIndentThumbStyle}"/>
                                    <telerik:RulerThumb x:Name="PART_ParagraphHangingIndent" RulerThumbType="Indent" Canvas.ZIndex="10" ToolTipText="Hanging Indent" Style="{StaticResource HangingIndentThumbStyle}"/>
                                    <telerik:RulerThumb x:Name="PART_ParagraphLeftIndent" RulerThumbType="LeftIndent" Canvas.ZIndex="10" ToolTipText="Left Indent" Style="{StaticResource LeftIndentThumbStyle}"/>
                                    <telerik:RulerThumb x:Name="PART_ParagraphRightIndent" Canvas.ZIndex="10" ToolTipText="Right Indent" Style="{StaticResource RightIndentThumbStyle}" RulerThumbType="Indent"/>
                                    <telerik:RulerThumb x:Name="PART_TabStopMarker" Canvas.ZIndex="0" Foreground="{telerik:VisualStudio2013Resource ResourceKey=BasicBrush}"/>
                                    <telerik:RulerThumb x:Name="PART_FirstLineIndentMarker" RulerThumbType="FirstLineIndent" Canvas.ZIndex="0" Style="{StaticResource FirstLineIndentThumbStyle}"/>
                                    <telerik:RulerThumb x:Name="PART_IndentMarker" RulerThumbType="Indent" Canvas.ZIndex="0" Style="{StaticResource HangingIndentThumbStyle}"/>
                                    <telerik:RulerThumb x:Name="PART_LeftIndentMarker" RulerThumbType="LeftIndent" Canvas.ZIndex="0" Style="{StaticResource LeftIndentThumbStyle}"/>
                                </Canvas>
                                <Canvas x:Name="PART_TabStopMarkersContainer" Grid.Row="1" Height="5"/>
                            </Grid>
                        </Canvas>
                        <Canvas x:Name="PART_VerticalCanvas"
                                Grid.Row="1"
                                Background="{appearance:Office2016Resource Resource=DocumentBackground}"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch">
                            <Grid Grid.Row="1" x:Name="PART_VerticalRulerContainer" Margin="5 0" Width="14">
                                <Canvas>
                                    <Rectangle x:Name="PART_TopMarginRectangle" Style="{StaticResource PageMarginStyle}" Width="14"/>
                                    <Rectangle x:Name="PART_PageVerticalRectangle"
                                            Fill="{appearance:Office2016Resource Resource=PageRectangleFill}"
                                            Canvas.Left="0"
                                            Canvas.Top="0"
                                            Width="14"
                                            Stroke="{appearance:Office2016Resource Resource=PageMarginBackground}"
                                            StrokeThickness="1"/>
                                    <Rectangle x:Name="PART_BottomMarginRectangle" Style="{StaticResource PageMarginStyle}" Width="14"/>
                                </Canvas>
                                <Canvas x:Name="PART_VerticalMarkersContainer"/>
                                <Canvas x:Name="PART_VerticalThumbBackgroundsContainer"/>
                                <Canvas x:Name="PART_VerticalThumbsContainer"/>
                            </Grid>
                        </Canvas>
                        <Border Background="{appearance:Office2016Resource Resource=PageMarginBackground}"
                                BorderBrush="{appearance:Office2016Resource Resource=PageMarginBackground}"
                                BorderThickness="1">
                            <Border x:Name="PART_TabStops"
                                    Background="{appearance:Office2016Resource Resource=PageRectangleFill}"
                                    BorderBrush="{telerik:VisualStudio2013Resource ResourceKey=BasicBrush}"
                                    BorderThickness="1"
                                    Width="14"
                                    Height="14">
                                <telerik:RulerThumb x:Name="PART_RulerThumbTypeSelector" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0" IsHitTestVisible="False"/>
                            </Border>
                        </Border>
                        <Line x:Name="PART_MarkLine"
                                Grid.Row="1"
                                Grid.Column="1"
                                Stroke="{telerik:VisualStudio2013Resource ResourceKey=StrongBrush}"
                                StrokeThickness="1"
                                StrokeDashArray="1 1 1 1 1 3"
                                Margin="0 2 0 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="telerik:DocumentRulerBase" BasedOn="{StaticResource Office2016DocumentRulerBaseStyle}"/>
    <Style TargetType="telerik:DocumentRuler" BasedOn="{StaticResource Office2016DocumentRulerBaseStyle}"/>
    
    <Style x:Key="SimpleButtonStyle" TargetType="telerik:RadButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadButton">
                    <Grid SnapsToDevicePixels="True" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Content"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <ContentPresenter x:Name="Content"
                                                  TextBlock.Foreground="{TemplateBinding Foreground}"
                                                  Margin="{TemplateBinding Padding}"
                                                  Content="{TemplateBinding Content}"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                                  ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                  RecognizesAccessKey="True" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RichTextBoxTrackPredefinedStyle" TargetType="ContentControl" BasedOn="{StaticResource TrackPredefinedStyle}">
        <Setter Property="BorderBrush" Value="{appearance:Office2016Resource Resource=SliderBackground}"/>
        <Setter Property="Background" Value="{appearance:Office2016Resource Resource=SliderBackground}"/>
    </Style>

    <Style x:Key="RichTextBoxThumbPredefinedStyle" TargetType="Thumb">
        <Setter Property="BorderBrush" Value="{appearance:Office2016Resource Resource=SliderBackground}"/>
        <Setter Property="Background" Value="{appearance:Office2016Resource Resource=SliderBackground}"/>
        <Setter Property="Width" Value="6"/>
        <Setter Property="Height" Value="14"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Opacity" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LayoutModeButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="Background" Value="{appearance:Office2016Resource Resource=SliderBackground}"/>
        <Setter Property="Foreground" Value="{appearance:Office2016Resource Resource=SliderForeground}"/>
        <Setter Property="FontFamily" Value="{telerik:VisualStudio2013Resource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:VisualStudio2013Resource ResourceKey=FontSize}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadToggleButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.3"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledChecked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0"/>
                                        <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="DisabledCheckedVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                           
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}" 
                                Opacity="0.5"
                                Visibility="Collapsed" />

                        <ContentControl x:Name="Content"
                                Margin="{TemplateBinding Padding}"
                                Content="{TemplateBinding Content}"
                                Foreground="{TemplateBinding Foreground}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="telerikControlsRTBUIStatusBar:PercentComboBox">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikControlsRTBUIStatusBar:PercentComboBox">
                    <Grid x:Name="LayoutRoot">
                        <telerik:RadComboBox x:Name="comboPercent" IsEditable="True" SelectedIndex="3" IsTextSearchEnabled="False" VerticalAlignment="Center" Margin="0 1" MinHeight="20" Padding="4 0">
                            <telerik:RadComboBoxItem Content="25%"/>
                            <telerik:RadComboBoxItem Content="50%"/>
                            <telerik:RadComboBoxItem Content="75%"/>
                            <telerik:RadComboBoxItem Content="100%"/>
                            <telerik:RadComboBoxItem Content="150%"/>
                            <telerik:RadComboBoxItem Content="200%"/>
                            <telerik:RadComboBoxItem Content="500%"/>
                        </telerik:RadComboBox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="telerikControlsRTBUIStatusBar:NonLinearSlider">
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikControlsRTBUIStatusBar:NonLinearSlider">
                    <Grid x:Name="LayoutRoot">
                        <telerik:RadSlider x:Name="slider"
                                Minimum="0"
                                Maximum="1"
                                LargeChange="0.05"
                                SmallChange="0.005"
                                TrackStyle="{StaticResource RichTextBoxTrackPredefinedStyle}"
                                ThumbStyle="{StaticResource RichTextBoxThumbPredefinedStyle}"
                                Background="{appearance:Office2016Resource Resource=SliderBackground}"
                                VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="telerikControlsRTBUIStatusBar:LayoutModeSelector" BasedOn="{StaticResource LayoutModeSelectorStyle}">
        <Setter Property="Foreground" Value="{appearance:Office2016Resource Resource=SliderForeground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikControlsRTBUIStatusBar:LayoutModeSelector">
                    <StackPanel x:Name="LayoutRoot" Orientation="Horizontal" UseLayoutRounding="True">
                        <telerik:RadToggleButton x:Name="btnPrintLayout"
                                IsTabStop="False"
                                IsBackgroundVisible="False"
                                VerticalAlignment="Center"
                                Width="22"
                                Height="22"
                                Style="{StaticResource LayoutModeButtonStyle}"
                                Focusable="False">
                            <Image Stretch="None" Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/StatusBar/print_layout.png"/>
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton x:Name="btnWebLayout"
                                Margin="4 0 0 0"
                                IsTabStop="False"
                                IsBackgroundVisible="False"
                                VerticalAlignment="Center"
                                Width="22"
                                Height="22"
                                Style="{StaticResource LayoutModeButtonStyle}"
                                Focusable="False">
                            <Image Stretch="None" Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/StatusBar/web_layout.png"/>
                        </telerik:RadToggleButton>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="telerikControlsRTBUIStatusBar:ZoomController">
        <Setter Property="Foreground" Value="{appearance:Office2016Resource Resource=SliderForeground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikControlsRTBUIStatusBar:ZoomController">
                    <Grid x:Name="LayoutRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="70"/>
                            <ColumnDefinition Width="4"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*" MinWidth="120"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <telerikControlsRTBUIStatusBar:PercentComboBox x:Name="comboZoom"/>
                        <telerik:RadButton Grid.Column="2" x:Name="buttonZoomOut" Width="16" Height="16" BorderThickness="0" Padding="3" Margin="8 0 0 0" Style="{StaticResource SimpleButtonStyle}" VerticalContentAlignment="Center">
                            <Path Data="M461.1,217.7 L469.3,217.7" Stretch="Fill" Stroke="{TemplateBinding Foreground}" StrokeThickness="2" Width="10" Height="2" VerticalAlignment="Center"/>
                        </telerik:RadButton>
                        <telerikControlsRTBUIStatusBar:NonLinearSlider x:Name="sliderZoom" VerticalAlignment="Center" Grid.Column="3"/>
                        <telerik:RadButton Grid.Column="4" x:Name="buttonZoomIn" Width="16" Height="16" BorderThickness="0" Padding="3" Margin="4 0 0 0" Style="{StaticResource SimpleButtonStyle}">
                            <Path Data="M5,1L5,9 M1,5L9,5" Stretch="None" StrokeThickness="2" Stroke="{TemplateBinding Foreground}" VerticalAlignment="Center" />
                        </telerik:RadButton>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="telerik:RadRichTextBoxStatusBar" BasedOn="{StaticResource RadRichTextBoxStatusBarStyle}">
        <Setter Property="Background" Value="{appearance:Office2016Resource Resource=StatusBarBackground}"/>
    </Style>
</ResourceDictionary>
