<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
        xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:telerikToolBar="clr-namespace:Telerik.Windows.Controls.ToolBar;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:telerikNavigationPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:telerikRibbonView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonView"
        xmlns:telerikKeyTips="clr-namespace:Telerik.Windows.Controls.RibbonView.KeyTips;assembly=Telerik.Windows.Controls.RibbonView"
        xmlns:telerikRibbonViewPrimitives="clr-namespace:Telerik.Windows.Controls.RibbonView.Primitives;assembly=Telerik.Windows.Controls.RibbonView"
        xmlns:c="http://schemas.telerik.com/2008/xaml/compile"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="c"
        xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:shell="clr-namespace:Telerik.Windows.Controls.RibbonView.Shell;assembly=Telerik.Windows.Controls.RibbonView">
    <telerik1:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <telerik1:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
    <SolidColorBrush x:Key="RibbonButtonDropDownArrowBorder" Color="#EFF6FC"/>
    <SolidColorBrush x:Key="RibbonButtonDropDownArrow" Color="#7a7b7d"/>
    <SolidColorBrush x:Key="DropDownPopupBackgroundBrush" Color="#FF3D3D3D"/>
    <SolidColorBrush x:Key="DropDownPopupBorderBrush" Color="#868686"/>
    <CornerRadius x:Key="SplitButton_LeftPartCornerRadius">3 0 0 3</CornerRadius>
    <CornerRadius x:Key="SplitButton_RightPartCornerRadius">0 3 3 0</CornerRadius>
    <CornerRadius x:Key="SplitButton_TopPartCornerRadius">3 3 0 0</CornerRadius>
    <CornerRadius x:Key="SplitButton_BottomPartCornerRadius">0 0 3 3</CornerRadius>
    <CornerRadius x:Key="ControlOuterBorder_CornerRadius">3</CornerRadius>
    <SolidColorBrush x:Key="ControlOuterBorder" Color="#FF595959"/>
    <SolidColorBrush x:Key="ControlBackground" Color="#FF3D3D3D"/>
    <sys:Double x:Key="ControlElement_Height">4</sys:Double>
    <sys:Double x:Key="ControlElement_Width">8</sys:Double>
    <SolidColorBrush x:Key="ControlInnerBorder_Disabled" Color="Transparent"/>
    <SolidColorBrush x:Key="ControlBackground_Disabled" Color="#FF666666"/>
    <SolidColorBrush x:Key="ControlElement_Normal" Color="#FFC5C2C2"/>
    <SolidColorBrush x:Key="ControlForeground_Normal" Color="#FFDDDDDD"/>
    <LinearGradientBrush x:Key="ControlOuterBorder_Normal" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FF707070" Offset="0"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
        <GradientStop Color="#FF707070" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ControlBackground_Normal" Color="#FF575859"/>
    <LinearGradientBrush x:Key="ControlOuterBorder_MouseOver" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FFB0B0B0" Offset="0"/>
        <GradientStop Color="#FFB0B0B0" Offset="1"/>
        <GradientStop Color="#FFE0E1E2" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ControlBackground_MouseOver" Color="#FF878787"/>
    <SolidColorBrush x:Key="ControlForeground_Pressed" Color="#FFC5C2C2"/>
    <SolidColorBrush x:Key="ControlOuterBorder_Pressed" Color="#FF1A1A1A"/>
    <LinearGradientBrush x:Key="ControlBackground_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF2E2D2D" Offset="0"/>
        <GradientStop Color="#FF424242" Offset="1"/>
        <GradientStop Color="#FF424242" Offset="0.14"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ControlElement_Active" Color="#FF262626"/>
    <SolidColorBrush x:Key="ControlForeground_Active" Color="#FF262626"/>
    <LinearGradientBrush x:Key="ControlOuterBorder_Checked" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FF595959" Offset="0"/>
        <GradientStop Color="#FF595959" Offset="1"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ControlBackground_Checked" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF616060" Offset="0"/>
        <GradientStop Color="#FFCDCDCD" Offset="1"/>
        <GradientStop Color="#FFCDCDCD" Offset="0.14"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ControlOuterBorder_MouseOverChecked" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FF767679" Offset="0"/>
        <GradientStop Color="#FF767679" Offset="1"/>
        <GradientStop Color="#FFB2B3B4" Offset="0.5"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ControlBackground_MouseOverChecked" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF616060" Offset="0"/>
        <GradientStop Color="#FFAAAAAA" Offset="1"/>
        <GradientStop Color="#FFAAAAAA" Offset="0.14"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#FF789FC3"/>
    <SolidColorBrush x:Key="ControlBackground_Focused" Color="Transparent"/>
    <Style x:Key="RadButtonStyle" TargetType="telerik1:RadButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackground_Normal}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}"/>
        <Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorder_CornerRadius}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlForeground_Pressed}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{StaticResource ControlBackground_MouseOver}"
                                BorderBrush="{StaticResource ControlOuterBorder_MouseOver}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Pressed}"
                                BorderBrush="{StaticResource ControlOuterBorder_Pressed}"/>
                        <Border x:Name="DisabledVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                BorderBrush="{StaticResource ControlInnerBorder_Disabled}"
                                Background="{StaticResource ControlBackground_Disabled}"/>
                        <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"/>
                        <Border x:Name="FocusVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                Background="{StaticResource ControlBackground_Focused}"
                                BorderBrush="{StaticResource ControlOuterBorder_Focused}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadPathButtonPathStyle" TargetType="Path">
        <Setter Property="Fill" Value="{StaticResource ControlElement_Normal}"/>
        <Setter Property="Stretch" Value="Fill"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style x:Key="RadPathButtonStyle" TargetType="telerik1:RadPathButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackground_Normal}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}"/>
        <Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorder_CornerRadius}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="PathStyle" Value="{StaticResource RadPathButtonPathStyle}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadPathButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlForeground_Pressed}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Path" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ContentPlacement">
                                <VisualState x:Name="ContentPlacementAtLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 3 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ContentPlacementAtTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 3</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ContentPlacementAtRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>3 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ContentPlacementAtBottom">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 3 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ContentVisibilityStates">
                                <VisualState x:Name="Visible"/>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{StaticResource ControlBackground_MouseOver}"
                                BorderBrush="{StaticResource ControlOuterBorder_MouseOver}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Pressed}"
                                BorderBrush="{StaticResource ControlOuterBorder_Pressed}"/>
                        <Border x:Name="DisabledVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                BorderBrush="{StaticResource ControlInnerBorder_Disabled}"
                                Background="{StaticResource ControlBackground_Disabled}"/>
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Path x:Name="Path" Grid.Column="1" Grid.Row="1" Style="{TemplateBinding PathStyle}" Data="{TemplateBinding PathGeometry}"/>
                            <Grid x:Name="ContentHost" Grid.Column="1" Grid.Row="2">
                                <ContentPresenter x:Name="Content"
                                        TextBlock.Foreground="{TemplateBinding Foreground}"
                                        Margin="{TemplateBinding ContentMargin}"
                                        Content="{TemplateBinding Content}"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                        ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                        RecognizesAccessKey="True"/>
                            </Grid>
                        </Grid>
                        <Border x:Name="FocusVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                Background="{StaticResource ControlBackground_Focused}"
                                BorderBrush="{StaticResource ControlOuterBorder_Focused}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadToggleButtonStyle" TargetType="telerik1:RadToggleButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackground_Normal}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}"/>
        <Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorder_CornerRadius}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadToggleButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOverChecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOverChecked}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlOuterBorder_MouseOverChecked}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlForeground_Active}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{StaticResource ControlBackground_MouseOver}"
                                BorderBrush="{StaticResource ControlOuterBorder_MouseOver}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{StaticResource ControlOuterBorder_Pressed}"
                                Background="{StaticResource ControlBackground_Pressed}"/>
                        <Border x:Name="DisabledVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                BorderBrush="{StaticResource ControlInnerBorder_Disabled}"
                                Background="{StaticResource ControlBackground_Disabled}"/>
                        <Border x:Name="FocusVisual"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Focused}"
                                BorderBrush="{StaticResource ControlOuterBorder_Focused}"/>
                        <Border x:Name="CheckedVisual"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{StaticResource ControlOuterBorder_Checked}"
                                Background="{StaticResource ControlBackground_Checked}"/>
                        <ContentPresenter x:Name="Content"
                                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="RadRadioButtonStyle" TargetType="telerik1:RadRadioButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackground_Normal}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}"/>
        <Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorder_CornerRadius}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadRadioButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOverChecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOverChecked}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlOuterBorder_MouseOverChecked}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlForeground_Active}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_MouseOver}"
                                BorderBrush="{StaticResource ControlOuterBorder_MouseOver}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Pressed}"
                                BorderBrush="{StaticResource ControlOuterBorder_Pressed}"/>
                        <Border x:Name="DisabledVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                BorderBrush="{StaticResource ControlInnerBorder_Disabled}"
                                Background="{StaticResource ControlBackground_Disabled}"/>
                        <Border x:Name="FocusVisual"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Focused}"
                                BorderBrush="{StaticResource ControlOuterBorder_Focused}"/>
                        <Border x:Name="CheckedVisual"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{StaticResource ControlOuterBorder_Checked}"
                                Background="{StaticResource ControlBackground_Checked}"/>
                        <ContentPresenter x:Name="Content"
                                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="RadDropDownButtonStyle" TargetType="telerik1:RadDropDownButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackground_Normal}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorder_CornerRadius}"/>
        <Setter Property="IsOpen" Value="false"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadDropDownButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsOpenState">
                                <VisualState x:Name="Closed"/>
                                <VisualState x:Name="Opened">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlElement_Active}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlForeground_Active}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DropDownButtonPosition">
                                <VisualState x:Name="DropDownButtonAtLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtBottom">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="PopupPlacementState">
                                <VisualState x:Name="PlacementBottom"/>
                                <VisualState x:Name="PlacementTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="RenderTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="180"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PlacementLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="RenderTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="90"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PlacementRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="RenderTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="-90"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_MouseOver}"
                                BorderBrush="{StaticResource ControlOuterBorder_MouseOver}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Pressed}"
                                BorderBrush="{StaticResource ControlOuterBorder_Pressed}"/>
                        <Border x:Name="DisabledVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                BorderBrush="{StaticResource ControlInnerBorder_Disabled}"
                                Background="{StaticResource ControlBackground_Disabled}"/>
                        <Border x:Name="CheckedVisual"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Checked}"
                                BorderBrush="{StaticResource ControlOuterBorder_Checked}"/>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter x:Name="Content"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    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 x:Name="DropDownIndicator"
                                    IsHitTestVisible="False"
                                    Grid.Column="1"
                                    Grid.Row="2"
                                    HorizontalAlignment="Center"
                                    Canvas.ZIndex="2"
                                    VerticalAlignment="Center"
                                    RenderTransformOrigin="0.5,0.5"
                                    Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                                    Margin="5 3">
                                <Path x:Name="Path" Data="M0,0 4,4 8,0 6,0 4,2 2,0Z" Fill="{StaticResource ControlElement_Normal}"/>
                            </Grid>
                        </Grid>
                        <Popup x:Name="DropDownPopup" AllowsTransparency="True" StaysOpen="False" Focusable="False" Placement="Bottom">
                            <Grid>
                                <Border x:Name="DropDownPopupBorder"
                                        BorderThickness="1"
                                        MinWidth="3"
                                        MinHeight="3"
                                        Width="{TemplateBinding DropDownWidth}"
                                        Height="{TemplateBinding DropDownHeight}"
                                        MaxWidth="{TemplateBinding DropDownMaxWidth}"
                                        MaxHeight="{TemplateBinding DropDownMaxHeight}"
                                        Background="{StaticResource ControlBackground}"
                                        BorderBrush="{StaticResource ControlOuterBorder}">
                                    <ContentControl x:Name="DropDownPopupContent"
                                            Foreground="{TemplateBinding Foreground}"
                                            Content="{TemplateBinding DropDownContent}"
                                            HorizontalContentAlignment="Stretch"
                                            VerticalContentAlignment="Stretch"
                                            ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Stretch"
                                            DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"
                                            ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                            ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                </Border>
                            </Grid>
                        </Popup>
                        <Border x:Name="FocusVisual"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Focused}"
                                BorderBrush="{StaticResource ControlOuterBorder_Focused}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadSplitButtonToggleButtonStyle" BasedOn="{StaticResource RadToggleButtonStyle}" TargetType="telerik1:RadToggleButton">
        <Setter Property="Foreground" Value="{StaticResource ControlElement_Normal}"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadToggleButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOverChecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_MouseOverChecked}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlOuterBorder_MouseOverChecked}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{StaticResource ControlBackground_MouseOver}"
                                BorderBrush="{StaticResource ControlOuterBorder_MouseOver}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{StaticResource ControlOuterBorder_Pressed}"
                                Background="{StaticResource ControlBackground_Pressed}"/>
                        <Border x:Name="DisabledVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                BorderBrush="{StaticResource ControlInnerBorder_Disabled}"
                                Background="{StaticResource ControlBackground_Disabled}"/>
                        <Border x:Name="FocusVisual"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{StaticResource ControlBackground_Focused}"
                                BorderBrush="{StaticResource ControlOuterBorder_Focused}"/>
                        <Border x:Name="CheckedVisual"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{StaticResource ControlOuterBorder_Checked}"
                                Background="{StaticResource ControlBackground_Checked}"/>
                        <ContentPresenter x:Name="Content"
                                Content="{TemplateBinding Content}"
                                Margin="{TemplateBinding Padding}"
                                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="RadSplitButtonStyle" TargetType="telerik1:RadSplitButton">
        <Setter Property="IsTabStop" Value="true"/>
        <Setter Property="IsOpen" Value="false"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="ButtonPartStyle" Value="{StaticResource RadButtonStyle}"/>
        <Setter Property="TogglePartStyle" Value="{StaticResource RadSplitButtonToggleButtonStyle}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackground_Normal}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="CornerRadius" Value="{StaticResource ControlOuterBorder_CornerRadius}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadSplitButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard/>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsCheckedState">
                                <VisualState x:Name="UnChecked"/>
                                <VisualState x:Name="Checked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsOpenState">
                                <VisualState x:Name="Closed"/>
                                <VisualState x:Name="Opened">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Canvas.ZIndex)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsOpenOrChecked">
                                <VisualState x:Name="OpenOrChecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlForeground_Active}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlForeground_Active}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_Checked}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="IsBackgroundVisible">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CommonStatesWrapper" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NotOpenNotChecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DropDownButtonPosition">
                                <VisualState x:Name="DropDownButtonAtLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 -1 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="CornerRadius" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SplitButton_LeftPartCornerRadius}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="CornerRadius" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SplitButton_RightPartCornerRadius}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 -1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="CornerRadius" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SplitButton_TopPartCornerRadius}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="CornerRadius" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SplitButton_BottomPartCornerRadius}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>-1 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtBottom">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="CornerRadius" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SplitButton_BottomPartCornerRadius}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="CornerRadius" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SplitButton_TopPartCornerRadius}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ButtonPartVisibility">
                                <VisualState x:Name="ButtonInvisible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.RowSpan)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>3</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>3</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ButtonVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden"/>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Double>0</sys:Double>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Double>1</sys:Double>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik1:RadButton x:Name="ButtonPart"
                                    IsTabStop="False"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=IsButtonPartVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
                                    Background="{TemplateBinding Background}"
                                    Style="{TemplateBinding ButtonPartStyle}"
                                    Padding="{TemplateBinding Padding}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    IsBackgroundVisible="{TemplateBinding IsBackgroundVisible}"
                                    Foreground="{TemplateBinding Foreground}"
                                    FontSize="{TemplateBinding FontSize}"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    MinHeight="{TemplateBinding MinHeight}"
                                    CornerRadius="{StaticResource SplitButton_LeftPartCornerRadius}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                    ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                    Focusable="False"/>
                            <telerik1:RadToggleButton x:Name="DropDownPart"
                                    Margin="-1 0 0 0"
                                    Grid.Row="1"
                                    Grid.Column="2"
                                    IsTabStop="False"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Background="{TemplateBinding Background}"
                                    Style="{TemplateBinding TogglePartStyle}"
                                    FontSize="{TemplateBinding FontSize}"
                                    IsBackgroundVisible="{TemplateBinding IsBackgroundVisible}"
                                    Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                                    IsChecked="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                    MinHeight="9"
                                    MinWidth="15"
                                    CornerRadius="{StaticResource SplitButton_RightPartCornerRadius}"
                                    Focusable="False">
                                <Grid x:Name="PART_DropDownIndicatorInner"
                                        IsHitTestVisible="False"
                                        HorizontalAlignment="Center"
                                        Canvas.ZIndex="2"
                                        VerticalAlignment="Center"
                                        RenderTransformOrigin="0.5,0.5"
                                        Margin="0 0 0 0">
                                    <Path x:Name="Path"
                                            Fill="{Binding (TextElement.Foreground), RelativeSource={RelativeSource AncestorType=ContentPresenter}}"
                                            Data="M0,0 4,4 8,0 6,0 4,2 2,0Z"
                                            Margin="5 3"
                                            Width="{StaticResource ControlElement_Width}"
                                            Height="{StaticResource ControlElement_Height}"
                                            Stretch="Fill"/>
                                </Grid>
                            </telerik1:RadToggleButton>
                        </Grid>
                        <Border x:Name="CommonStatesWrapper" Visibility="{Binding Path=IsPressed, ElementName = DropDownPart, Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
                            <Border x:Name="FocusVisual"
                                    Visibility="{Binding Path=IsPressed, ElementName = ButtonPart, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"
                                    Background="{x:Null}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    Opacity="0"
                                    BorderBrush="{StaticResource ControlOuterBorder_Focused}"/>
                        </Border>
                        <Popup x:Name="DropDownPopup" AllowsTransparency="True" StaysOpen="False" Focusable="False" Placement="Bottom">
                            <Grid>
                                <Border x:Name="DropDownPopupBorder"
                                        BorderThickness="1"
                                        MinWidth="3"
                                        MinHeight="3"
                                        Width="{TemplateBinding DropDownWidth}"
                                        Height="{TemplateBinding DropDownHeight}"
                                        MaxWidth="{TemplateBinding DropDownMaxWidth}"
                                        MaxHeight="{TemplateBinding DropDownMaxHeight}"
                                        Background="{StaticResource ControlBackground}"
                                        BorderBrush="{StaticResource ControlOuterBorder}">
                                    <ContentControl x:Name="DropDownPopupContent"
                                            Foreground="{TemplateBinding Foreground}"
                                            Content="{TemplateBinding DropDownContent}"
                                            ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                            HorizontalContentAlignment="Stretch"
                                            VerticalContentAlignment="Stretch"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Stretch"
                                            DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                                </Border>
                            </Grid>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerik1:RadButton" BasedOn="{StaticResource RadButtonStyle}"/>
    <Style TargetType="telerik1:RadPathButton" BasedOn="{StaticResource RadPathButtonStyle}"/>
    <Style TargetType="telerik1:RadToggleButton" BasedOn="{StaticResource RadToggleButtonStyle}"/>
    <Style TargetType="telerik1:RadRadioButton" BasedOn="{StaticResource RadRadioButtonStyle}"/>
    <Style TargetType="telerik1:RadDropDownButton" BasedOn="{StaticResource RadDropDownButtonStyle}"/>
    <Style TargetType="telerik1:RadSplitButton" BasedOn="{StaticResource RadSplitButtonStyle}"/>
    <SolidColorBrush x:Key="DialogLauncher_Fill1" Color="#FFB0B0B0"/>
    <SolidColorBrush x:Key="DialogLauncher_Fill2" Color="Black"/>
    <SolidColorBrush x:Key="ApplicationMenu_OuterBorder" Color="#FF707070"/>
    <SolidColorBrush x:Key="ApplicationMenu_Background" Color="#FF212224"/>
    <SolidColorBrush x:Key="ApplicationMenu_Foreground" Color="#FFDDDDDD"/>
    <SolidColorBrush x:Key="RibbonControlBackground_Disabled" Color="#FF666666"/>
    <SolidColorBrush x:Key="RibbonOuterBackground_Normal" Color="#FF333333"/>
    <SolidColorBrush x:Key="RibbonControlBackground_Highlighted" Color="#FF878787"/>
    <SolidColorBrush x:Key="RibbonPickerPopupBackground" Color="#FF3D3D3D"/>
    <LinearGradientBrush x:Key="RibbonControlOuterBorder_Highlighted" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FFB0B0B0"/>
        <GradientStop Color="#FFB0B0B0" Offset="1"/>
        <GradientStop Color="#FFE0E1E2" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="GroupHeaderBackgroundBrush" Color="#FF2D2E32"/>
    <LinearGradientBrush x:Key="GroupHeaderBorderBrush" EndPoint="0.96,0.5" StartPoint="0.052,0.5">
        <GradientStop Color="#FF707070" Offset="0"/>
        <GradientStop Color="#FF707070" Offset="1"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
    </LinearGradientBrush>
    <CornerRadius x:Key="RibbonTabOuterCornerRadius">3.5</CornerRadius>
    <CornerRadius x:Key="RibbonTabInnerCornerRadius">2.5</CornerRadius>
    <SolidColorBrush x:Key="RibbonBackgroundBrush" Color="#FF212224"/>
    <SolidColorBrush x:Key="RibbonForegroundBrush" Color="#FFDDDDDD"/>
    <SolidColorBrush x:Key="RibbonTitlebarBackgroundBrush" Color="#FF5B5A5A"/>
    <SolidColorBrush x:Key="RibbonTitlebarApplicationNameBrush" Color="#FFDDDDDD"/>
    <SolidColorBrush x:Key="RibbonTabBackgroundBrush" Color="#FF2D2E32"/>
    <LinearGradientBrush x:Key="RibbonTabOuterBorderBrush" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FF707070" Offset="0"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
        <GradientStop Color="#FF707070" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RibbonTabInnerBorderBrush" Color="Transparent"/>
    <SolidColorBrush x:Key="TabStripTabNormalForegroundBrush">#FFDDDDDD</SolidColorBrush>
    <LinearGradientBrush x:Key="TabMouseOverOuterBorder" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FF707070"/>
        <GradientStop Color="#FF707070" Offset="1"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="TabMouseOverBackground" Color="#FF525151"/>
    <SolidColorBrush x:Key="TabSelectedOuterBorder" Color="#FF707070"/>
    <SolidColorBrush x:Key="TabSelectedBackground" Color="#FF2D2E32"/>
    <SolidColorBrush x:Key="RibbonGroupHeaderBrush" Color="#FFDDDDDD"/>
    <SolidColorBrush x:Key="RibbonGroupButtonBorderBrush" Color="#a0a0a0"/>
    <SolidColorBrush x:Key="RibbonGroupButtonBackgroundBrush" Color="#55FFFFFF"/>
    <SolidColorBrush x:Key="RibbonGroupButtonBottomBrush" Color="#c2c2c2"/>
    <SolidColorBrush x:Key="RibbonGroupButtonArrow" Color="#DDDDDD"/>
    <SolidColorBrush x:Key="RibbonGroupSeparatorLightBrush" Color="#F8FAFC"/>
    <SolidColorBrush x:Key="ContextualGroup_Foreground" Color="White"/>
    <SolidColorBrush x:Key="ContextualGroup_BorderBrush" Color="#FF87AED3"/>
    <SolidColorBrush Color="#FF575859" x:Key="ButtonGroupBackgroundBrush"/>
    <LinearGradientBrush x:Key="ButtonGroupOuterBorderBrush" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FF707070" Offset="0"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
        <GradientStop Color="#FF707070" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ButtonGroupDividerLightBrush" Color="#44FFFFFF"/>
    <SolidColorBrush x:Key="RibbonPopupForegroundBrush" Color="#DDDDDD"/>
    <SolidColorBrush x:Key="RibbonGalleryBackgroundBrush" Color="Transparent"/>
    <LinearGradientBrush x:Key="RibbonGalleryBorderBrush" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FF707070" Offset="0"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
        <GradientStop Color="#FF707070" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RibbonGalleryItemBackgroundBrush" Color="#FF575859"/>
    <SolidColorBrush x:Key="RibbonGalleryHeaderBackground" Color="#FF575656"/>
    <SolidColorBrush x:Key="RibbonGalleryHeaderBorderBrush" Color="#FF707070"/>
    <SolidColorBrush x:Key="RibbonGalleryHeaderForeground" Color="#FFDDDDDD"/>
    <Thickness x:Key="RibbonGalleryHeaderBorderThickness">0 0 0 0</Thickness>
    <SolidColorBrush x:Key="ApplicationMenuMiddleBorderBrush" Color="#FF2D2E32"/>
    <SolidColorBrush x:Key="ApplicationMenuContentOuterBorderBrush" Color="#FF595959"/>
    <SolidColorBrush x:Key="ButtonHoverOuterBorderBrush" Color="#CC727272"/>
    <SolidColorBrush x:Key="QatBelowBackgroundBrush" Color="#FF2C2C2C"/>
    <LinearGradientBrush x:Key="QatBelowOuterBorderBrush" EndPoint="0.983,0.5" StartPoint="0.021,0.5">
        <GradientStop Color="#FF595959" Offset="0"/>
        <GradientStop Color="#FF595959" Offset="1"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="PageScrollViewerButtonBackgroundBrush" Color="#FF2D2E32"/>
    <SolidColorBrush x:Key="PageScrollViewerPressedButtonBackgroundBrush" Color="#FF525151"/>
    <SolidColorBrush x:Key="PageScrollViewerHotButtonBackgroundBrush" Color="#FF525151"/>
    <SolidColorBrush x:Key="PageScrollViewerButtonOuterBorderBrush" Color="#FF707070"/>
    <SolidColorBrush x:Key="PageScrollViewerButtonForegroundBrush" Color="#FFDDDDDD"/>
    <SolidColorBrush x:Key="QuickAccessKeyHintBackgroundBrush" Color="#FF3D3D3D"/>
    <LinearGradientBrush x:Key="QuickAccessKeyHintBorderBrush" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FF707070" Offset="0"/>
        <GradientStop Color="#FF707070" Offset="1"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="QuickAccessKeyHintForegroundBrush" Color="#FFDDDDDD"/>
    <LinearGradientBrush x:Key="RibbonComboBoxBorderBrush" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FF707070" Offset="0"/>
        <GradientStop Color="#FF707070" Offset="1"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RibbonComboBoxForegroundBrush" Color="#dddddd"/>
    <SolidColorBrush x:Key="RadGalleryItemOver_background" Color="#FF565656"/>
    <SolidColorBrush x:Key="RadGalleryItemPressed_background" Color="#FF6C6C6C"/>
    <SolidColorBrush x:Key="RadRibbonBarButtonOverBorderInner" Color="Transparent"/>
    <SolidColorBrush x:Key="RadRibbonBarButtonOverBackground" Color="#FF878787"/>
    <LinearGradientBrush x:Key="RadRibbonBarButtonOverBorder" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FFB0B0B0" Offset="0"/>
        <GradientStop Color="#FFB0B0B0" Offset="1"/>
        <GradientStop Color="#FFE0E1E2" Offset="0.5"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RadRibbonBarButtonPressedBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF2E2D2D" Offset="0"/>
        <GradientStop Color="#FF424242" Offset="1"/>
        <GradientStop Color="#FF424242" Offset="0.14"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RadRibbonBarButtonPressedBorder" Color="#FF1A1A1A"/>
    <SolidColorBrush x:Key="RadRibbonBarButtonPressedBorderInner" Color="Transparent"/>
    <LinearGradientBrush x:Key="RadRibbonBarButtonSelectedBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF616060" Offset="0"/>
        <GradientStop Color="#FFCDCDCD" Offset="1"/>
        <GradientStop Color="#FFCDCDCD" Offset="0.14"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RadRibbonBarButtonSelectedBorder" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FF595959" Offset="0"/>
        <GradientStop Color="#FF595959" Offset="1"/>
        <GradientStop Color="#FFA3A3A3" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RadRibbonBarButtonNormalForegroundBrush">#FFDDDDDD</SolidColorBrush>
    <SolidColorBrush x:Key="RadRibbonBarButtonSelectedForegroundBrush">#FF262626</SolidColorBrush>
    <SolidColorBrush x:Key="RadRibbonBarDropDownButtonPressedBorder" Color="#FF1A1A1A"/>
    <SolidColorBrush x:Key="ApplicationRibbonButtonOverBackground" Color="#FF878787"/>
    <LinearGradientBrush x:Key="ApplicationRibbonButtonOverBorder" EndPoint="0.971000015735626,0.5" StartPoint="0.0399999991059303,0.5">
        <GradientStop Color="#FFB0B0B0" Offset="0"/>
        <GradientStop Color="#FFB0B0B0" Offset="1"/>
        <GradientStop Color="#FFE0E1E2" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RadRibbonGroupOverBorder" Color="#66636363"/>
    <LinearGradientBrush x:Key="RadRibbonGroupOverBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#66FFFFFF"/>
        <GradientStop Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RadRibbonGroupPressedBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF2E2D2D" Offset="0"/>
        <GradientStop Color="#FF424242" Offset="1"/>
        <GradientStop Color="#FF424242" Offset="0.14"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RadRibbonGroupPressedBorder" Color="#FF1A1A1A"/>
    <LinearGradientBrush x:Key="RibbonBarKeyTips_Background" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#CCFFFFFF"/>
        <GradientStop Color="#66FFFFFF" Offset="1"/>
        <GradientStop Color="#99FFFFFF" Offset="0.5"/>
        <GradientStop Color="#B2A1A1A1" Offset="0.51"/>
    </LinearGradientBrush>
    <SolidColorBrush Color="#B2000000" x:Key="RibbonBarKeyTips_OuterBorderBrush"/>
    <SolidColorBrush Color="#CCFFFFFF" x:Key="RibbonBarKeyTips_InnerBorderBrush"/>
    <SolidColorBrush Color="#000000" x:Key="RibbonWindow_OuterBorder"/>
    <SolidColorBrush Color="#FF494A4D" x:Key="RibbonWindow_Background"/>
    <SolidColorBrush x:Key="RibbonWindow_ContentBackground" Color="#FF3D3D3D"/>
    <SolidColorBrush x:Key="RibbonWindow_TitlebarApplicationNameBrush" Color="#FFFFFFFF"/>
    <LinearGradientBrush x:Key="RibbonWindow_Path_InnerBorder" EndPoint="0.9,0.5" StartPoint="0.1,0.5">
        <GradientStop Color="#FFB0B0B0" Offset="0"/>
        <GradientStop Color="#FFB0B0B0" Offset="1"/>
        <GradientStop Color="#FFE0E1E2" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush Color="#FF262626" x:Key="RibbonWindow_Path_Background"/>
    <SolidColorBrush x:Key="RibbonWindow_Separator_Background" Color="#FF595959"/>
    <SolidColorBrush x:Key="ApplicationButtonType2010_Foreground" Color="#FFDDDDDD"/>
    <SolidColorBrush x:Key="ApplicationButtonType2010_OuterBorder" Color="#FF707070"/>
    <SolidColorBrush x:Key="ApplicationButtonType2010_OuterBorder_MouseOver" Color="#FFB0B0B0"/>
    <LinearGradientBrush x:Key="ApplicationButtonType2010_Background_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF878787" Offset="0.9"/>
        <GradientStop Color="#FF878787"/>
        <GradientStop Color="#FF575859" Offset="0.391"/>
        <GradientStop Color="#FF878787" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ApplicationButtonType2010_OuterBorder_Selected" Color="#FF707070"/>
    <LinearGradientBrush x:Key="ApplicationButtonType2010_Background_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF575859" Offset="0.9"/>
        <GradientStop Color="#FF616060"/>
        <GradientStop Color="#FF2D2E32" Offset="0.4"/>
        <GradientStop Color="#FF575859" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_DottedLineBrush" StartPoint="0,0.5" EndPoint="4,0.5" MappingMode="Absolute" SpreadMethod="Repeat">
        <GradientStop Color="#40000000" Offset="0"/>
        <GradientStop Color="#40000000" Offset="0.5"/>
        <GradientStop Color="Transparent" Offset="0.501"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RibbonnBackStage_Background" Color="#FF3D3D3D"/>
    <SolidColorBrush x:Key="RibbonnBackStage_BorderBrush" Color="#FF4E4E4E"/>
    <LinearGradientBrush x:Key="RibbonnBackStage_BorderBrushRight" EndPoint="0,0.5" StartPoint="1,0.5">
        <GradientStop Color="#4D000000"/>
        <GradientStop Offset="1" Color="#00000000"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_TopLine" EndPoint="0.981000006198883,0.5" StartPoint="0.0199999995529652,0.5">
        <GradientStop Color="#FF575859" Offset="0"/>
        <GradientStop Color="#FF575859" Offset="0.991"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RibbonnBackStage_BackgroundContent" Color="#FF3B3B3B"/>
    <SolidColorBrush x:Key="RibbonnBackStage_Item_OuterBorderMouseOVer" Color="#FFB0B0B0"/>
    <SolidColorBrush x:Key="RibbonnBackStage_Item_BackgroundMouseOVer" Color="#FF878787"/>
    <SolidColorBrush x:Key="RibbonnBackStage_Item_OuterBorderSelected" Color="#FF707070"/>
    <LinearGradientBrush x:Key="RibbonnBackStage_Item_InnerBorderSelected" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF575859"/>
        <GradientStop Color="#FF575859" Offset="1"/>
        <GradientStop Offset="0.1" Color="#33575859"/>
        <GradientStop Offset="0.9" Color="#33575859"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_Item_OuterBackgroundSelected" EndPoint="0.958,0.5" StartPoint="0.065,0.5">
        <GradientStop Color="#FF575859" Offset="0"/>
        <GradientStop Color="#FF575859" Offset="0.996"/>
        <GradientStop Color="Gainsboro" Offset="0.5"/>
    </LinearGradientBrush>
    <RadialGradientBrush x:Key="RibbonnBackStage_Item_InnerBackgroundSelected" GradientOrigin="1.017,0.053" RadiusY="1.009" RadiusX="0.74" Center="1.015,0.993">
        <RadialGradientBrush.RelativeTransform>
            <TransformGroup>
                <RotateTransform CenterX="0.857" CenterY="1.064" Angle="-180"/>
                <TranslateTransform X="-0.186" Y="-0.528"/>
            </TransformGroup>
        </RadialGradientBrush.RelativeTransform>
        <GradientStop Color="Gainsboro" Offset="0.355"/>
        <GradientStop Offset="0.996" Color="#00181818"/>
    </RadialGradientBrush>
    <SolidColorBrush Color="#FFDDDDDD" x:Key="RibbonBackstage_Item_Foreground"/>
    <SolidColorBrush Color="#FFDDDDDD" x:Key="RibbonBackstage_Item_HeaderForeground"/>
    <SolidColorBrush Color="#FF000000" x:Key="RibbonBackstage_Item_ForegroundSelected"/>
    <SolidColorBrush x:Key="RibbonnBackStage_ArrowBackground" Color="#FF3b3b3b"/>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerBackground" EndPoint="0.718,0.246" StartPoint="0.91,0.887">
        <GradientStop Color="#FF0E0E0E" Offset="0.257"/>
        <GradientStop Color="#FF3B3B3B" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerPath1" EndPoint="0.13,0.955" StartPoint="0.833,0.4">
        <GradientStop Color="#4CDEDEDE"/>
        <GradientStop Color="#2CB9BABA" Offset="0.226"/>
        <GradientStop Color="#2CB9BABA" Offset="0.874"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerPath2" EndPoint="0.954,0.137" StartPoint="0.343,0.931">
        <GradientStop Color="#FF2D2E32"/>
        <GradientStop Color="#00CDCDCD" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerPath3" EndPoint="0.858,0.387" StartPoint="0.943,1.006">
        <GradientStop Color="#992D2E32" Offset="0.4"/>
        <GradientStop Color="#1A424545" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerPath4" EndPoint="0.65,0.407" StartPoint="0.706,0.72">
        <GradientStop Color="#591A1A1A" Offset="0.161"/>
        <GradientStop Color="#51CDCDCD" Offset="0.695"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerPath5" EndPoint="0.443,0.565" StartPoint="0.466,0.797">
        <GradientStop Color="#26000000" Offset="0.157"/>
        <GradientStop Color="#16FFFFFF" Offset="0.996"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerPath6" EndPoint="0.97,0.171" StartPoint="0.087,1.037">
        <GradientStop Color="#B6FFFFFF" Offset="0"/>
        <GradientStop Color="#80FFFFFF" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="RibbonnBackStage_CornerPath7" EndPoint="0.928,0.037" StartPoint="0.09,0.9">
        <GradientStop Color="#FFA1A1A1" Offset="0"/>
        <GradientStop Color="Gainsboro" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RibbonButtonDropDownFill" Color="#FFC5C2C2"/>
    <SolidColorBrush x:Key="GroupChrome_Background" Color="#FF2D2E32"/>
    <SolidColorBrush x:Key="GroupChrome_BorderBrush" Color="#FF707070"/>
    <SolidColorBrush x:Key="GroupChrome_TrayBackground" Color="#FF525151"/>
    <SolidColorBrush x:Key="ApplicationMenu_ClippingRectangleFill" Color="Transparent"/>
    <SolidColorBrush x:Key="RibbonWindowButtonsHoverColor" Color="#FFE0E1E2"/>
    <SolidColorBrush x:Key="RibbonWindowButtonsPressedColor" Color="#FFE0E1E2"/>
    <telerik:BooleanToVisibilityConverter x:Key="RibbonBooleanToVisibilityConverter"/>
    <telerik:InvertedBooleanToVisibilityConverter x:Key="InvertBoolToVisConverter"/>
    <telerikRibbonView:BooleanToWindowStateConverter x:Key="BooleanToWindowStateConverter"/>
    <telerikRibbonView:IconConverter x:Key="IconConverter"/>
    <ControlTemplate x:Key="RadRibbonButtonTemplate" TargetType="telerikRibbonView:RadRibbonButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonBackgroundHover"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonBackgroundHover"/>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonBackgroundPressed"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused"/>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="ButtonBackgroundDecorator"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    CornerRadius="{TemplateBinding CornerRadius}"/>
            <Border x:Name="ButtonBackgroundPressed"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"/>
            <Border x:Name="ButtonBackgroundHover"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Border x:Name="KeyboardNavigationVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Grid
                    Margin="{TemplateBinding Padding}"
                    x:Name="ContentGrid"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Name="Image" VerticalAlignment="Top"/>
                <StackPanel x:Name="FirstRowContainer" Grid.Row="1" Tag="qq">
                    <ContentPresenter x:Name="ContentPresenter"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            RecognizesAccessKey="True"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            TextBlock.Foreground="{TemplateBinding Foreground}"/>
                    <TextBlock Name="textRow1" Text="{TemplateBinding TextRow1}" TextAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
                </StackPanel>
                <TextBlock
                        Name="textRow2"
                        Grid.Row="2"
                        VerticalAlignment="Top"
                        Margin="0 -3 0 0"
                        Text="{TemplateBinding TextRow2}"
                        TextAlignment="Center"
                        Foreground="{TemplateBinding Foreground}"/>
            </Grid>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonButtonStyle" TargetType="telerikRibbonView:RadRibbonButton">
        <Setter Property="Template" Value="{StaticResource RadRibbonButtonTemplate}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource RadRibbonBarButtonNormalForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonButton" BasedOn="{StaticResource RadRibbonButtonStyle}"/>
    <Style TargetType="telerik:RadToggleButton" x:Key="ToggleButtonStyle">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="MinWidth" Value="36"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadToggleButton">
                    <Grid Background="Transparent">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Chrome">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonOverBackground}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Chrome">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonOverBorder}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Chrome">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonPressedBackground}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Chrome">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonPressedBorder}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Path" Storyboard.TargetProperty="Opacity" Duration="0" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ChromeCheck" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unhecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ChromeCheck" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Chrome"
                                Grid.ColumnSpan="2"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="ChromeCheck"
                                Grid.ColumnSpan="2"
                                Visibility="Collapsed"
                                Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                                BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border Grid.Column="1">
                            <Path x:Name="Path" VerticalAlignment="Center" HorizontalAlignment="Right" Width="5" Height="3" Fill="{TemplateBinding Foreground}" Data="M0,0L5,0L2.5,3z" Margin="5 0"/>
                        </Border>
                        <ContentPresenter x:Name="Content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="EditableRibbonComboBox" TargetType="telerikRibbonView:RadRibbonComboBox">
        <Grid x:Name="ContentPresenterBorder" Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonOuterBackground_Normal}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonControlBackground_Disabled}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_DropDownButton" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonControlBackground_Disabled}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PART_EditableTextBox" Storyboard.TargetProperty="Opacity" To="0.6"/>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="0.6"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="DropDownOpen"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="WatermarkStates">
                    <VisualState x:Name="WatermarkVisible">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Watermark" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="WatermarkInvisible"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_DropDownButton" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <SolidColorBrush Color="Transparent"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="OuterBorder"
                    Grid.ColumnSpan="2"
                    IsHitTestVisible="False"
                    Background="{StaticResource RibbonOuterBackground_Normal}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <Border x:Name="Border"
                    Grid.ColumnSpan="2"
                    IsHitTestVisible="False"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{x:Null}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <TextBox x:Name="PART_EditableTextBox"
                    BorderThickness="0"
                    BorderBrush="Transparent"
                    Padding="{TemplateBinding Padding}"
                    FontSize="{TemplateBinding FontSize}"
                    Foreground="{TemplateBinding Foreground}"
                    IsReadOnly="{TemplateBinding IsReadOnly}"
                    Background="Transparent"
                    VerticalAlignment="Center"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                <TextBox.Template>
                    <ControlTemplate TargetType="TextBox">
                        <Grid>
                            <ScrollViewer
                                    Padding="{TemplateBinding Padding}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Background="Transparent"
                                    IsTabStop="False"
                                    VerticalScrollBarVisibility="Auto"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Name="PART_ContentHost"/>
                        </Grid>
                    </ControlTemplate>
                </TextBox.Template>
            </TextBox>
            <Border x:Name="KeyboardNavigationVisual" Opacity="0" Grid.Column="1" Background="{StaticResource RadRibbonBarButtonOverBackground}"/>
            <telerik:RadToggleButton x:Name="PART_DropDownButton"
                    Grid.Column="1"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Style="{StaticResource ToggleButtonStyle}"
                    IsTabStop="False"
                    IsChecked="{TemplateBinding IsDropDownOpen}"
                    IsEnabled="{TemplateBinding IsEnabled}"
                    MinWidth="15"/>
            <TextBlock x:Name="Watermark"
                    Text="{TemplateBinding EmptyText}"
                    Opacity=".5"
                    IsHitTestVisible="False"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Left"
                    Margin="5 0 0 0"
                    Visibility="Collapsed"/>
            <Popup x:Name="PART_Popup">
                <Grid x:Name="PopupRoot">
                    <Border
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            MinWidth="{TemplateBinding MinDropDownWidth}"
                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
                            Margin="0 -1 0 0"
                            Background="{StaticResource RibbonPickerPopupBackground}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <telerik:RadButton x:Name="PART_ClearButton"
                                    Margin="-1 -1 -1 0"
                                    CornerRadius="0"
                                    Visibility="{TemplateBinding ClearSelectionButtonVisibility}"
                                    Content="{TemplateBinding ClearSelectionButtonContent}"/>
                            <ScrollViewer x:Name="PART_ScrollViewer"
                                    Grid.Row="1"
                                    Padding="0"
                                    BorderThickness="0"
                                    VerticalScrollBarVisibility="Auto"
                                    Foreground="{TemplateBinding Foreground}"
                                    CanContentScroll="True">
                                <ItemsPresenter/>
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="NonEditableRibbonComboBox" TargetType="telerikRibbonView:RadRibbonComboBox">
        <Grid x:Name="ContentPresenterBorder" Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterElement" Storyboard.TargetProperty="Opacity">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.5"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonControlBackground_Disabled}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterElement" Storyboard.TargetProperty="Opacity">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.5"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="DropDownOpen"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_DropDownButton" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <SolidColorBrush Color="Transparent"/>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="OuterBorder" IsHitTestVisible="False" Background="{StaticResource RibbonOuterBackground_Normal}"/>
            <Border x:Name="Border" IsHitTestVisible="False" Background="{TemplateBinding Background}"/>
            <Border x:Name="KeyboardNavigationVisual" Opacity="0" Background="{StaticResource RadRibbonBarButtonOverBackground}"/>
            <telerik:RadToggleButton x:Name="PART_DropDownButton"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Style="{StaticResource ToggleButtonStyle}"
                    ClickMode="Press"
                    IsChecked="{TemplateBinding IsDropDownOpen}"
                    IsEnabled="{TemplateBinding IsEnabled}"
                    IsTabStop="False">
                <ContentPresenter x:Name="ContentPresenterElement"
                        Margin="{TemplateBinding Padding}"
                        IsHitTestVisible="False"
                        Content="{TemplateBinding SelectionBoxItem}"
                        ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </telerik:RadToggleButton>
            <Popup x:Name="PART_Popup">
                <Grid x:Name="PopupRoot">
                    <Border
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            MinWidth="{TemplateBinding MinDropDownWidth}"
                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
                            Margin="0 -1 0 0"
                            Background="{StaticResource RibbonPickerPopupBackground}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <telerik:RadButton x:Name="PART_ClearButton" Margin="-1 -1 -1 0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}" Content="{TemplateBinding ClearSelectionButtonContent}"/>
                            <ScrollViewer x:Name="PART_ScrollViewer"
                                    Grid.Row="1"
                                    Foreground="{TemplateBinding Foreground}"
                                    Padding="0 1"
                                    BorderThickness="0"
                                    VerticalScrollBarVisibility="Auto"
                                    Margin="0"
                                    CanContentScroll="True">
                                <ItemsPresenter/>
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonComboBoxStyle" TargetType="telerikRibbonView:RadRibbonComboBox">
        <Setter Property="Template" Value="{StaticResource EditableRibbonComboBox}"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonComboBoxForegroundBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{StaticResource RibbonComboBoxBorderBrush}"/>
        <Setter Property="MinHeight" Value="24"/>
        <Setter Property="Padding" Value="6 2"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="IsEditable" Value="True"/>
        <Setter Property="Margin" Value="0 0 1 0"/>
        <Setter Property="ClearSelectionButtonContent" Value="Clear"/>
        <Setter Property="EditableTemplate" Value="{StaticResource EditableRibbonComboBox}"/>
        <Setter Property="NonEditableTemplate" Value="{StaticResource NonEditableRibbonComboBox}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>
    <ControlTemplate x:Key="RibbonComboBoxItemTemplate" TargetType="telerikRibbonView:RadRibbonComboBoxItem">
        <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightVisual" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.3"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid>
                <Border x:Name="HighlightVisual"
                        Visibility="Collapsed"
                        Background="{StaticResource RibbonControlBackground_Highlighted}"
                        BorderBrush="{StaticResource RibbonControlOuterBorder_Highlighted}"
                        BorderThickness="1"/>
                <ContentPresenter x:Name="Content" Margin="{TemplateBinding Padding}" VerticalAlignment="Center"/>
            </Grid>
        </Border>
    </ControlTemplate>
    <Style x:Key="RadRibbonComboBoxItemStyle" TargetType="telerikRibbonView:RadRibbonComboBoxItem">
        <Setter Property="Template" Value="{StaticResource RibbonComboBoxItemTemplate}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonComboBoxForegroundBrush}"/>
        <Setter Property="Padding" Value="3 1"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonComboBoxItem" BasedOn="{StaticResource RadRibbonComboBoxItemStyle}"/>
    <Style TargetType="telerikRibbonView:RadRibbonComboBox" BasedOn="{StaticResource RadRibbonComboBoxStyle}"/>
    <ControlTemplate x:Key="RadRibbonDropDownButtonTemplate" TargetType="telerikRibbonView:RadRibbonDropDownButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard Duration="0">
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusState">
                    <VisualState x:Name="Focused"/>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="IsOpenState">
                    <VisualState x:Name="Closed"/>
                    <VisualState x:Name="Opened">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MouseOverVisual">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckedVisual"/>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="Fill">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownButtonPositionState">
                    <VisualState x:Name="DropDownButtonAtTop"/>
                    <VisualState x:Name="DropDownButtonAtLeft"/>
                    <VisualState x:Name="DropDownButtonAtBottom"/>
                    <VisualState x:Name="DropDownButtonAtRight">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.Column)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>3</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.Row)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>0</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="VerticalAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <VerticalAlignment>Center</VerticalAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>3</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>3</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(Grid.Column)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>1</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstRowContainer" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>3</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstRowContainer" Storyboard.TargetProperty="(Grid.Column)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>1</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstRowContainer" Storyboard.TargetProperty="Orientation">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Orientation>Horizontal</Orientation>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Image" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>3</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownPlacementState">
                    <VisualState x:Name="PlacementBottom"/>
                    <VisualState x:Name="PlacementTop"/>
                    <VisualState x:Name="PlacementLeft"/>
                    <VisualState x:Name="PlacementRight"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownContentState">
                    <VisualState x:Name="HasDropDownContent"/>
                    <VisualState x:Name="WithoutDropDownContent">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DropDownIndicator">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropShadowVisibilityState">
                    <VisualState x:Name="HasShadow"/>
                    <VisualState x:Name="WithoutShadow"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="NormalVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    CornerRadius="{TemplateBinding CornerRadius}"/>
            <Border x:Name="PressedVisual"
                    Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"/>
            <Border x:Name="CheckedVisual"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonSelectedBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonSelectedBorder}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <Border x:Name="MouseOverVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Border x:Name="KeyboardNavigationVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Grid x:Name="ContentGrid" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Image Name="Image"/>
                <StackPanel x:Name="FirstRowContainer" Grid.Row="1">
                    <ContentPresenter x:Name="ContentPresenter"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            RecognizesAccessKey="True"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            TextBlock.Foreground="{TemplateBinding Foreground}"/>
                    <TextBlock Name="textRow1" Grid.Row="1" Text="{TemplateBinding TextRow1}" TextAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
                </StackPanel>
                <StackPanel Name="DropDownPanel" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Top" Orientation="Horizontal" Margin="0 -3 0 0">
                    <TextBlock Name="textRow2" Text="{TemplateBinding TextRow2}" Foreground="{TemplateBinding Foreground}"/>
                    <Path
                            Name="DropDownIndicator"
                            IsHitTestVisible="False"
                            VerticalAlignment="Center"
                            Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                            Fill="{StaticResource RibbonButtonDropDownFill}"
                            Width="5"
                            Height="3"
                            Margin="3 6"
                            Data="M0,0 L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z"/>
                </StackPanel>
            </Grid>
            <Popup x:Name="DropDownPopup" AllowsTransparency="True" StaysOpen="False" Focusable="False" Placement="Bottom">
                <Grid>
                    <Border x:Name="DropDownPopupBorder"
                            BorderThickness="1"
                            Padding="1"
                            Margin="0"
                            MinWidth="3"
                            MinHeight="3"
                            Width="{TemplateBinding DropDownWidth}"
                            Height="{TemplateBinding DropDownHeight}"
                            MaxWidth="{TemplateBinding DropDownMaxWidth}"
                            MaxHeight="{TemplateBinding DropDownMaxHeight}"
                            Background="{StaticResource DropDownPopupBackgroundBrush}"
                            BorderBrush="{StaticResource DropDownPopupBorderBrush}">
                        <ContentControl x:Name="DropDownPopupContent"
                                Content="{TemplateBinding DropDownContent}"
                                IsTabStop="False"
                                ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonDropDownButtonStyle" TargetType="telerikRibbonView:RadRibbonDropDownButton">
        <Setter Property="Template" Value="{StaticResource RadRibbonDropDownButtonTemplate}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="DropDownButtonPosition" Value="Bottom"/>
        <Setter Property="Foreground" Value="{StaticResource RadRibbonBarButtonNormalForegroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonDropDownButton" BasedOn="{StaticResource RadRibbonDropDownButtonStyle}"/>
    <ControlTemplate x:Key="RadRibbonRadioButtonTemplate" TargetType="telerikRibbonView:RadRibbonRadioButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused"/>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MouseOverVisual">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckedVisual"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="NormalVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    CornerRadius="{TemplateBinding CornerRadius}"/>
            <Border x:Name="PressedVisual"
                    Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"/>
            <Border x:Name="CheckedVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonSelectedBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonSelectedBorder}"/>
            <Border x:Name="MouseOverVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Border x:Name="KeyboardNavigationVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ContentGrid">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Name="Image" VerticalAlignment="Top"/>
                <StackPanel x:Name="FirstRowContainer" Grid.Row="1">
                    <ContentPresenter x:Name="ContentPresenter"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            RecognizesAccessKey="True"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            TextBlock.Foreground="{TemplateBinding Foreground}"/>
                    <TextBlock Name="textRow1" Text="{TemplateBinding TextRow1}" TextAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
                </StackPanel>
                <TextBlock
                        Name="textRow2"
                        Grid.Row="2"
                        VerticalAlignment="Top"
                        Margin="0 -3 0 0"
                        Text="{TemplateBinding TextRow2}"
                        TextAlignment="Center"
                        Foreground="{TemplateBinding Foreground}"/>
            </Grid>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonRadioButtonStyle" TargetType="telerikRibbonView:RadRibbonRadioButton">
        <Setter Property="Padding" Value="3"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Foreground" Value="{StaticResource RadRibbonBarButtonNormalForegroundBrush}"/>
        <Setter Property="Template" Value="{StaticResource RadRibbonRadioButtonTemplate}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonRadioButton" BasedOn="{StaticResource RadRibbonRadioButtonStyle}"/>
    <ControlTemplate x:Key="RadRibbonSplitButtonTemplate" TargetType="telerikRibbonView:RadRibbonSplitButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="BorderThickness">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="BorderThickness">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="mouseOverDecorator" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorPart" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard/>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="BorderThickness">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="IsBackgroundVisible">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Boolean>False</sys:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="BorderThickness">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="IsBackgroundVisible">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Boolean>False</sys:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="IsOpenState">
                    <VisualState x:Name="Closed"/>
                    <VisualState x:Name="Opened">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="Fill">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusState">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="Text1VisibilityState">
                    <VisualState x:Name="Text1Show"/>
                    <VisualState x:Name="Text1Hide">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Padding">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>1 0 3 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="Text2VisibilityState">
                    <VisualState x:Name="Text2Show"/>
                    <VisualState x:Name="Text2Hide">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Padding">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>2 0 3 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownButtonPositionState">
                    <VisualState x:Name="DropDownButtonAtTop"/>
                    <VisualState x:Name="DropDownButtonAtLeft"/>
                    <VisualState x:Name="DropDownButtonAtBottom">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Image" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>3 3 3 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="DropDownButtonAtRight">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>4</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.Column)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>4</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.Row)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>0</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>1 0 0 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="VerticalAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <VerticalAlignment>Center</VerticalAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBorderButton" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>4</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBorderButton" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBorderButton" Storyboard.TargetProperty="CornerRadius">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <CornerRadius>3 0 0 3</CornerRadius>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorPart" Storyboard.TargetProperty="HorizontalAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <HorizontalAlignment>Right</HorizontalAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorPart" Storyboard.TargetProperty="VerticalAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <VerticalAlignment>Stretch</VerticalAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorPart" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>4</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="CornerRadius">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <CornerRadius>3 0 0 3</CornerRadius>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="CornerRadius">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <CornerRadius>0 3 3 0</CornerRadius>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>0</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="(Grid.Row)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>0</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="(Grid.Column)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>1</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>4 0 1 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="VerticalAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <VerticalAlignment>Center</VerticalAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="HorizontalAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <HorizontalAlignment>Left</HorizontalAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="TextAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <TextAlignment>Left</TextAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>4</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>1</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Image" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>4</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Image" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>1</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownContentState">
                    <VisualState x:Name="HasDropDownContent"/>
                    <VisualState x:Name="WithoutDropDownContent">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DropDownIndicator">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="IsOpenOrChecked">
                    <VisualState x:Name="OpenOrChecked">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="checkedDecorator" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="IsBackgroundVisible">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Boolean>True</sys:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="NotOpenNotChecked"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="backgroundDecorator"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="2"/>
            <Border x:Name="KeyboardNavigationVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Grid x:Name="ContentGrid">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <telerik:RadButton x:Name="ButtonPart"
                        Grid.ColumnSpan="3"
                        MinHeight="0"
                        MinWidth="0"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        IsBackgroundVisible="{TemplateBinding IsBackgroundVisible}"
                        Background="Transparent"
                        IsTabStop="False"
                        Style="{TemplateBinding ButtonPartStyle}"
                        Foreground="{TemplateBinding Foreground}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        Padding="{TemplateBinding Padding}"
                        ContentStringFormat="{TemplateBinding ContentStringFormat}"
                        CornerRadius="3 3 0 0"/>
                <Border x:Name="CheckBorderButton"
                        Grid.ColumnSpan="3"
                        CornerRadius="2 2 0 0"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Background="{x:Null}"
                        Margin="1"
                        Opacity="0"
                        BorderBrush="{StaticResource RadRibbonBarButtonPressedBorderInner}"/>
                <telerik:RadToggleButton x:Name="DropDownPart"
                        Grid.Row="1"
                        Grid.RowSpan="4"
                        Foreground="{TemplateBinding Foreground}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        MinHeight="0"
                        Style="{TemplateBinding TogglePartStyle}"
                        Grid.ColumnSpan="2"
                        Background="Transparent"
                        IsTabStop="False"
                        Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                        HorizontalAlignment="Stretch"
                        Padding="6"
                        CornerRadius="0 0 3 3"
                        IsChecked="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                <Rectangle x:Name="SeparatorPart"
                        Grid.ColumnSpan="2"
                        MinWidth="1"
                        MinHeight="1"
                        Visibility="Collapsed"
                        IsHitTestVisible="False"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Bottom"
                        Fill="{StaticResource RadRibbonBarButtonOverBorder}"
                        SnapsToDevicePixels="True"/>
                <Image Name="Image" IsHitTestVisible="False" Margin="{TemplateBinding Padding}" Grid.ColumnSpan="2" HorizontalAlignment="Center"/>
                <TextBlock
                        Name="textRow1"
                        Grid.Row="1"
                        Grid.ColumnSpan="2"
                        IsHitTestVisible="False"
                        Padding="3 0"
                        Text="{TemplateBinding TextRow1}"
                        TextAlignment="Center"
                        Foreground="{TemplateBinding Foreground}"/>
                <StackPanel
                        Name="DropDownPanel"
                        VerticalAlignment="Top"
                        Grid.Row="2"
                        Grid.ColumnSpan="2"
                        Grid.RowSpan="2"
                        HorizontalAlignment="Center"
                        Orientation="Horizontal"
                        Margin="3 -3 3 0"
                        IsHitTestVisible="False">
                    <TextBlock Name="textRow2" Text="{TemplateBinding TextRow2}" IsHitTestVisible="False" Foreground="{TemplateBinding Foreground}"/>
                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Path x:Name="DropDownIndicator"
                                IsHitTestVisible="False"
                                Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                                SnapsToDevicePixels="True"
                                Fill="{StaticResource RibbonButtonDropDownFill}"
                                Data="M0,0 L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z"
                                Margin="3 6"/>
                    </Grid>
                </StackPanel>
            </Grid>
            <Border x:Name="mouseOverDecorator"
                    Opacity="0"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"
                    CornerRadius="2"/>
            <Border x:Name="checkedDecorator"
                    Opacity="0"
                    BorderBrush="{StaticResource RadRibbonBarButtonSelectedBorder}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="2"/>
            <Popup x:Name="DropDownPopup"
                    AllowsTransparency="True"
                    StaysOpen="False"
                    Focusable="False"
                    Placement="Bottom"
                    IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}">
                <Grid>
                    <Border x:Name="DropDownPopupBorder"
                            BorderThickness="1"
                            MinWidth="3"
                            MinHeight="3"
                            Width="{TemplateBinding DropDownWidth}"
                            Height="{TemplateBinding DropDownHeight}"
                            MaxWidth="{TemplateBinding DropDownMaxWidth}"
                            MaxHeight="{TemplateBinding DropDownMaxHeight}"
                            Background="{StaticResource DropDownPopupBackgroundBrush}"
                            BorderBrush="{StaticResource DropDownPopupBorderBrush}"
                            Padding="1">
                        <ContentControl x:Name="DropDownPopupContent"
                                IsTabStop="False"
                                Content="{TemplateBinding DropDownContent}"
                                ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                    </Border>
                </Grid>
            </Popup>
            <Rectangle x:Name="disabledDecorator" Visibility="Collapsed" Opacity="0" Fill="#FFFFFFFF"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonSplitButtonStyle" TargetType="telerikRibbonView:RadRibbonSplitButton">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="IsOpen" Value="false"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="ButtonPartStyle" Value="{StaticResource RadButtonStyle}"/>
        <Setter Property="TogglePartStyle" Value="{StaticResource RadToggleButtonStyle}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="Foreground" Value="{StaticResource RadRibbonBarButtonNormalForegroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource RadRibbonSplitButtonTemplate}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonSplitButton" BasedOn="{StaticResource RadRibbonSplitButtonStyle}"/>
    <ControlTemplate x:Key="RadRibbonToggleButtonTemplate" TargetType="telerikRibbonView:RadRibbonToggleButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckedVisual"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MouseOverVisual">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(TextBlock.Foreground)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonSelectedForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused"/>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="NormalVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    CornerRadius="{TemplateBinding CornerRadius}"/>
            <Border x:Name="PressedVisual"
                    Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"/>
            <Border x:Name="CheckedVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonSelectedBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonSelectedBorder}"/>
            <Border x:Name="MouseOverVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Border x:Name="KeyboardNavigationVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
            <Grid x:Name="ContentGrid" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Name="Image" VerticalAlignment="Top"/>
                <StackPanel x:Name="FirstRowContainer" Grid.Row="1">
                    <ContentPresenter x:Name="ContentPresenter"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            RecognizesAccessKey="True"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            TextBlock.Foreground="{TemplateBinding Foreground}"/>
                    <TextBlock Name="textRow1" Text="{TemplateBinding TextRow1}" TextAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
                </StackPanel>
                <TextBlock
                        Name="textRow2"
                        Grid.Row="2"
                        VerticalAlignment="Top"
                        Margin="0 -3 0 0"
                        Text="{TemplateBinding TextRow2}"
                        TextAlignment="Center"
                        Foreground="{TemplateBinding Foreground}"/>
            </Grid>
            <Rectangle x:Name="Background_Disabled" Visibility="Collapsed" Fill="#99FFFFFF"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonToggleButtonStyle" TargetType="telerikRibbonView:RadRibbonToggleButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Foreground" Value="{StaticResource RadRibbonBarButtonNormalForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource RadRibbonToggleButtonTemplate}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonToggleButton" BasedOn="{StaticResource RadRibbonToggleButtonStyle}"/>
    <ControlTemplate x:Key="ApplicationDropDownButtonTemplate" TargetType="telerikRibbonViewPrimitives:RadRibbonApplicationDropDownButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverPart" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="00:00:00.1" Storyboard.TargetName="PressedPart" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="IsOpenState">
                    <VisualState x:Name="Closed"/>
                    <VisualState x:Name="Opened">
                        <Storyboard>
                            <DoubleAnimation Duration="00:00:00.1" Storyboard.TargetName="isOpenIndicator" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="KeyboardNavigationVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Border"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="2 2 0 0"/>
            <Border x:Name="MouseOverPart"
                    Background="{StaticResource ApplicationButtonType2010_Background_MouseOver}"
                    BorderBrush="{StaticResource ApplicationButtonType2010_OuterBorder_MouseOver}"
                    BorderThickness="1 1 1 0"
                    CornerRadius="2 2 0 0"
                    Opacity="0"/>
            <Border x:Name="PressedPart"
                    Background="{StaticResource ApplicationButtonType2010_Background_Selected}"
                    BorderBrush="{StaticResource ApplicationButtonType2010_OuterBorder_Selected}"
                    BorderThickness="1 1 1 0"
                    CornerRadius="2 2 0 0"
                    Opacity="0"/>
            <Border x:Name="isOpenIndicator"
                    Opacity="0"
                    Background="{StaticResource ApplicationButtonType2010_Background_Selected}"
                    BorderBrush="{StaticResource ApplicationButtonType2010_OuterBorder_Selected}"
                    BorderThickness="1 1 1 0"
                    CornerRadius="1 1 0 0"/>
            <Border x:Name="KeyboardNavigationVisual"
                    Opacity="0"
                    Background="{StaticResource ApplicationButtonType2010_Background_MouseOver}"
                    BorderBrush="{StaticResource ApplicationButtonType2010_OuterBorder_MouseOver}"
                    BorderThickness="1 1 1 0"
                    CornerRadius="2 2 0 0"/>
            <Grid x:Name="ContentGrid" Margin="{TemplateBinding Padding}">
                <ContentPresenter
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"/>
                <Image x:Name="Image" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Stretch="None"/>
                <TextBlock x:Name="textRow1" Margin="0 2 0 0" Text="{TemplateBinding TextRow1}" TextAlignment="Center"/>
            </Grid>
            <Popup x:Name="DropDownPopup" VerticalOffset="-1" AllowsTransparency="True" StaysOpen="True" Focusable="False">
                <Border x:Name="DropDownPopupBorder">
                    <ContentControl x:Name="DropDownPopupContent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="{TemplateBinding DropDownContent}"/>
                </Border>
            </Popup>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonApplicationDropDownButtonStyle" TargetType="telerikRibbonViewPrimitives:RadRibbonApplicationDropDownButton">
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Foreground" Value="{StaticResource ApplicationButtonType2010_Foreground}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{StaticResource ApplicationButtonType2010_OuterBorder}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinWidth" Value="46"/>
        <Setter Property="Margin" Value="1 0 0 0"/>
        <Setter Property="DropDownPlacement" Value="Relative"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="DropDownIndicatorVisibility" Value="Collapsed"/>
        <Setter Property="IsAutoSize" Value="False"/>
        <Setter Property="Template" Value="{StaticResource ApplicationDropDownButtonTemplate}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style BasedOn="{StaticResource RadRibbonApplicationDropDownButtonStyle}" TargetType="telerikRibbonViewPrimitives:RadRibbonApplicationDropDownButton"/>
    <Style x:Key="RadGalleryStyle" TargetType="telerikRibbonView:RadGallery">
        <Setter Property="ItemWidth" Value="156"/>
        <Setter Property="ItemHeight" Value="26"/>
        <Setter Property="ViewportWidth" Value="157"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <telerik:RadWrapPanel ItemWidth="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerikRibbonView:RadRibbonGallery}}, Path=ItemWidth}" ItemHeight="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerikRibbonView:RadRibbonGallery}}, Path=ItemHeight}"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikRibbonView:RadGallery">
                    <ScrollViewer x:Name="PART_ScrollViewer" Padding="0" VerticalAlignment="Stretch" IsTabStop="False" BorderThickness="0">
                        <ItemsPresenter Width="{TemplateBinding ViewportWidth}" HorizontalAlignment="Left"/>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikRibbonView:RadGallery" BasedOn="{StaticResource RadGalleryStyle}"/>
    <ControlTemplate x:Key="RadGalleryItemTemplate" TargetType="telerikRibbonView:RadGalleryItem">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadGalleryItemOver_background}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="SelectedMouseOver"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Unselected"/>
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background_Selected"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="HeaderStates">
                    <VisualState x:Name="IsNotHeader"/>
                    <VisualState x:Name="IsHeader">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Header_Background"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderThickness">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentControl" Storyboard.TargetProperty="HorizontalAlignment">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <HorizontalAlignment>Left</HorizontalAlignment>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="contentControl" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonGalleryHeaderForeground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>5 0 0 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="KeyboardNavigationVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Header_Background"
                    Opacity="0"
                    Background="{StaticResource RibbonGalleryHeaderBackground}"
                    BorderBrush="{StaticResource RibbonGalleryHeaderBorderBrush}"
                    BorderThickness="{StaticResource RibbonGalleryHeaderBorderThickness}"/>
            <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="1">
                <Grid Margin="{TemplateBinding Padding}">
                    <ContentControl x:Name="contentControl"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Content="{TemplateBinding Content}"
                            IsTabStop="False"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Foreground="{TemplateBinding Foreground}"
                            ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                    <Image x:Name="Image"
                            Stretch="None"
                            Source="{TemplateBinding Image}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Grid>
            </Border>
            <Border x:Name="Background_Selected"
                    Opacity="0"
                    Background="{x:Null}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{StaticResource RadGalleryItemPressed_background}"
                    Margin="1"/>
            <Border x:Name="KeyboardNavigationVisual"
                    Opacity="0"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{StaticResource RadGalleryItemOver_background}"
                    Margin="1"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadGalleryItemStyle" TargetType="telerikRibbonView:RadGalleryItem">
        <Setter Property="Template" Value="{StaticResource RadGalleryItemTemplate}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <c:if Condition="WPF">
            <Setter Property="Focusable" Value="False"/>
        </c:if>
        <Setter Property="BorderThickness" Value="5"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadGalleryItem" BasedOn="{StaticResource RadGalleryItemStyle}"/>
    <ControlTemplate x:Key="RadRibbonGalleryTemplate" TargetType="telerikRibbonView:RadRibbonGallery">
        <Grid>
            <Border x:Name="ExpandedBorder"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="0 1 1 0">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="14"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <ScrollViewer x:Name="ScrollViewer" Grid.RowSpan="3" VerticalScrollBarVisibility="Hidden" IsTabStop="False" BorderThickness="0" VerticalAlignment="Stretch" Padding="0 1">
                        <ContentPresenter x:Name="InRibbonHost" Width="{TemplateBinding ViewportWidth}" HorizontalAlignment="Left">
                            <ContentPresenter.Content>
                                <ItemsPresenter x:Name="ItemsPresenter"/>
                            </ContentPresenter.Content>
                        </ContentPresenter>
                    </ScrollViewer>
                    <telerikRibbonView:RadRibbonButton x:Name="ScrollUpButton"
                            telerikRibbonView:ScreenTip.Title="{TemplateBinding UpDownButtonTitle}"
                            CornerRadius="0 1 0 0"
                            HorizontalAlignment="Stretch"
                            Grid.Column="1"
                            Grid.Row="0"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            IsTabStop="False"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            VerticalContentAlignment="Center"
                            Padding="0"
                            Margin="-1 -1 -1 0"
                            Background="{StaticResource RibbonGalleryItemBackgroundBrush}">
                        <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource RibbonGroupButtonArrow}" Data="M 0,4 L4,0 L 8,4"/>
                    </telerikRibbonView:RadRibbonButton>
                    <telerikRibbonView:RadRibbonButton x:Name="ScrollDownButton"
                            telerikRibbonView:ScreenTip.Title="{TemplateBinding UpDownButtonTitle}"
                            CornerRadius="0"
                            HorizontalAlignment="Stretch"
                            Grid.Column="1"
                            Grid.Row="1"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            IsTabStop="False"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            VerticalContentAlignment="Center"
                            Padding="0"
                            Margin="-1 0 -1 0"
                            Background="{StaticResource RibbonGalleryItemBackgroundBrush}">
                        <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource RibbonGroupButtonArrow}" Data="M0,0 L8,0 4,4z"/>
                    </telerikRibbonView:RadRibbonButton>
                    <telerikRibbonView:RadRibbonDropDownButton x:Name="PopupButton"
                            telerikRibbonView:ScreenTip.Title="{TemplateBinding MoreButtonTitle}"
                            HorizontalAlignment="Stretch"
                            DropDownIndicatorVisibility="Collapsed"
                            VerticalContentAlignment="Center"
                            CornerRadius="0 0 1 0"
                            Visibility="{TemplateBinding PopupLaunchButtonVisibility}"
                            Grid.Column="1"
                            Grid.Row="2"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="0"
                            Margin="-1 0 -1 0"
                            Background="{StaticResource RibbonGalleryItemBackgroundBrush}">
                        <Path
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Stretch="None"
                                Fill="{StaticResource RibbonGroupButtonArrow}"
                                Data="M0,0 L0,1 L6,1 L6,0 M0,2 L3,6 L6,2"
                                Margin="0 2 0 0"/>
                    </telerikRibbonView:RadRibbonDropDownButton>
                </Grid>
            </Border>
            <telerikRibbonView:RadRibbonDropDownButton x:Name="CollapsedButton" Size="Large" LargeImage="{TemplateBinding Icon}" Text="{TemplateBinding Title}" Visibility="Collapsed">
                <telerikRibbonView:RadRibbonDropDownButton.DropDownContent>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <ScrollViewer Padding="0" HorizontalScrollBarVisibility="Hidden" IsTabStop="False" Height="{TemplateBinding PopupViewportHeight}" VerticalScrollBarVisibility="Visible">
                            <ContentPresenter x:Name="PopupHost" Width="{TemplateBinding PopupViewportWidth}"/>
                        </ScrollViewer>
                        <ItemsControl HorizontalContentAlignment="Stretch" Grid.Row="1" ItemsSource="{TemplateBinding PopupMenuItems}" Foreground="{TemplateBinding Foreground}" BorderThickness="0 1 0 0"/>
                    </Grid>
                </telerikRibbonView:RadRibbonDropDownButton.DropDownContent>
            </telerikRibbonView:RadRibbonDropDownButton>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonGalleryStyle" TargetType="telerikRibbonView:RadRibbonGallery">
        <Setter Property="Template" Value="{StaticResource RadRibbonGalleryTemplate}"/>
        <Setter Property="Background" Value="{StaticResource RibbonGalleryBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource RibbonGalleryBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
        <Setter Property="PopupViewportWidth" Value="241"/>
        <Setter Property="ViewportWidth" Value="240"/>
        <Setter Property="ItemWidth" Value="80"/>
        <Setter Property="ItemHeight" Value="63"/>
        <Setter Property="PopupLaunchButtonVisibility" Value="Visible"/>
        <Setter Property="Icon">
            <Setter.Value>
                <BitmapImage UriSource="pack://application:,,,/Telerik.Windows.Controls.RibbonView;component/RibbonGalleryCollapsedIcon.png"/>
            </Setter.Value>
        </Setter>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <telerik:RadWrapPanel ItemWidth="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerikRibbonView:RadRibbonGallery}}, Path=ItemWidth}" ItemHeight="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerikRibbonView:RadRibbonGallery}}, Path=ItemHeight}"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonGallery" BasedOn="{StaticResource RadRibbonGalleryStyle}"/>
    <ItemsPanelTemplate x:Key="ButtonGroupPanel">
        <telerikRibbonViewPrimitives:ButtonGroupPanel/>
    </ItemsPanelTemplate>
    <Style x:Key="RadButtonGroupStyle" TargetType="telerikRibbonView:RadButtonGroup">
        <Setter Property="Background" Value="{StaticResource ButtonGroupBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ButtonGroupOuterBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinHeight" Value="24"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="ItemsPanel" Value="{StaticResource ButtonGroupPanel}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikRibbonView:RadButtonGroup">
                    <Grid>
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
                        <ItemsPresenter Margin="{TemplateBinding Padding}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="RadButtonGroupItemTemplate" TargetType="telerikRibbonView:RadButtonGroupItem">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CollectionOrderStates">
                    <VisualState x:Name="FirstContainer"/>
                    <VisualState x:Name="DefaultContainer">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonItemsSeparator" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <StackPanel Orientation="Horizontal">
                <Border x:Name="ButtonItemsSeparator" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"/>
                <ContentControl
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        IsTabStop="False"
                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
            </StackPanel>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadButtonGroupItemStyle" TargetType="telerikRibbonView:RadButtonGroupItem">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="BorderThickness" Value="1 0 0 0"/>
        <Setter Property="BorderBrush" Value="{StaticResource ButtonGroupDividerLightBrush}"/>
        <Setter Property="Template" Value="{StaticResource RadButtonGroupItemTemplate}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadButtonGroup" BasedOn="{StaticResource RadButtonGroupStyle}"/>
    <Style TargetType="telerikRibbonView:RadButtonGroupItem" BasedOn="{StaticResource RadButtonGroupItemStyle}"/>
    <ControlTemplate x:Key="GroupChromeTemplate" TargetType="telerikRibbonViewPrimitives:GroupChrome">
        <Grid Background="Transparent">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Border
                    Grid.RowSpan="2"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    Margin="0 0 1 1"
                    CornerRadius="2"/>
            <Grid x:Name="Tray" Grid.Row="1" Margin="1 0 2 2" Background="{StaticResource GroupChrome_TrayBackground}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <ContentControl
                        Content="{TemplateBinding Header}"
                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        IsTabStop="False"
                        Margin="3 0"
                        ContentStringFormat="{TemplateBinding HeaderStringFormat}"
                        Foreground="{StaticResource RibbonGroupHeaderBrush}"/>
                <telerikRibbonView:RadRibbonButton
                        MinHeight="0"
                        MinWidth="0"
                        Visibility="{TemplateBinding DialogLauncherVisibility}"
                        x:Name="DialogLauncher"
                        Grid.Column="1"
                        IsAutoSize="False"
                        TabIndex="1"
                        IsTabStop="False"
                        Command="{TemplateBinding DialogLauncherCommand}"
                        CommandParameter="{TemplateBinding DialogLauncherCommandParameter}"
                        CommandTarget="{TemplateBinding DialogLauncherCommandTarget}"
                        Margin="1"
                        Width="15"
                        Height="14">
                    <telerikRibbonView:RadRibbonButton.Content>
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Width="8" Height="8">
                            <Path Fill="{StaticResource DialogLauncher_Fill1}" Data="M6,3 L7,3 L7,6 L7,7 L3,7 L3,6 L6,6 z M3,3 L4,3 L4,4 L6,4 L6,6 L4,6 L4,4 L3,4 z M0,0 L1,0 L6,0 L6,1 L1,1 L1,6 L0,6 L0,1 z" Margin="0 0 1 1"/>
                            <Path Margin="1 1 0 0" Data="M6,2 L7,2 L7,6 L7,7 L3,7 L3,6 L6,6 z M3,2 L4,2 L4,3 L3,3 z M0,0 L1,0 L5,0 L5,1 L1,1 L1,5 L0,5 L0,1 z" Fill="{StaticResource DialogLauncher_Fill2}"/>
                        </Grid>
                    </telerikRibbonView:RadRibbonButton.Content>
                </telerikRibbonView:RadRibbonButton>
            </Grid>
            <ContentPresenter Margin="{TemplateBinding Padding}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="GroupChromeStyle" TargetType="telerikRibbonViewPrimitives:GroupChrome">
        <Setter Property="Template" Value="{StaticResource GroupChromeTemplate}"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonGroupHeaderBrush}"/>
        <Setter Property="Background" Value="{StaticResource GroupChrome_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource GroupChrome_BorderBrush}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Padding" Value="4 2"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="telerikRibbonViewPrimitives:GroupChrome" BasedOn="{StaticResource GroupChromeStyle}"/>
    <ControlTemplate x:Key="RadGroupHeaderTemplate" TargetType="telerikRibbonView:RadGroupHeader">
        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <ContentControl
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    Margin="{TemplateBinding Padding}"
                    Foreground="{TemplateBinding Foreground}"
                    IsTabStop="False"/>
        </Border>
    </ControlTemplate>
    <Style x:Key="RadGroupHeaderStyle" TargetType="telerikRibbonView:RadGroupHeader">
        <Setter Property="Template" Value="{StaticResource RadGroupHeaderTemplate}"/>
        <Setter Property="Background" Value="{StaticResource GroupHeaderBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonPopupForegroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource GroupHeaderBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0 0 0 1"/>
        <Setter Property="Padding" Value="11 1 5 1"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadGroupHeader" BasedOn="{StaticResource RadGroupHeaderStyle}"/>
    <ControlTemplate x:Key="RadRibbonGroupDropDownButtonTemplate" TargetType="telerikRibbonView:RadRibbonDropDownButton">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual" To="1"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PressedVisual" To="1"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard Duration="0">
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusState">
                    <VisualState x:Name="Focused"/>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="IsOpenState">
                    <VisualState x:Name="Closed">
                        <Storyboard/>
                    </VisualState>
                    <VisualState x:Name="Opened">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PressedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownButtonPositionState">
                    <VisualState x:Name="DropDownButtonAtTop"/>
                    <VisualState x:Name="DropDownButtonAtLeft"/>
                    <VisualState x:Name="DropDownButtonAtBottom"/>
                    <VisualState x:Name="DropDownButtonAtRight">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.Column)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>3</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="(Grid.Row)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>0</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPanel" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>2 0 0 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Image" Storyboard.TargetProperty="(Grid.RowSpan)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Int32>2</sys:Int32>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow2" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownPlacementState">
                    <VisualState x:Name="PlacementBottom"/>
                    <VisualState x:Name="PlacementTop"/>
                    <VisualState x:Name="PlacementLeft"/>
                    <VisualState x:Name="PlacementRight"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownContentState">
                    <VisualState x:Name="HasDropDownContent"/>
                    <VisualState x:Name="WithoutDropDownContent">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DropDownIndicator">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropShadowVisibilityState">
                    <VisualState x:Name="HasShadow"/>
                    <VisualState x:Name="WithoutShadow"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="KeyboardNavigationVisual" To="1"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="NormalVisual"
                    Background="{TemplateBinding Background}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    CornerRadius="2"/>
            <Border x:Name="MouseOverVisual"
                    Opacity="0"
                    Background="{StaticResource RadRibbonGroupOverBackground}"
                    BorderBrush="{StaticResource RadRibbonGroupOverBorder}"
                    BorderThickness="1"
                    CornerRadius="2"/>
            <Border x:Name="PressedVisual"
                    Opacity="0"
                    Background="{StaticResource RadRibbonGroupPressedBackground}"
                    BorderBrush="{StaticResource RadRibbonGroupPressedBorder}"
                    BorderThickness="1"
                    CornerRadius="2"/>
            <Border x:Name="KeyboardNavigationVisual"
                    Opacity="0"
                    Background="{StaticResource RadRibbonGroupOverBackground}"
                    BorderBrush="{StaticResource RadRibbonGroupOverBorder}"
                    BorderThickness="1"
                    CornerRadius="2"/>
            <Grid Margin="{TemplateBinding Padding}" x:Name="ContentGrid" VerticalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter x:Name="ContentPresenter"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        RecognizesAccessKey="True"
                        TextBlock.Foreground="{TemplateBinding Foreground}"/>
                <Border x:Name="Image"
                        Margin="3"
                        Background="{StaticResource RibbonGroupButtonBackgroundBrush}"
                        BorderBrush="{StaticResource RibbonGroupButtonBorderBrush}"
                        BorderThickness="1"
                        CornerRadius="4"
                        Width="31"
                        Height="31">
                    <Grid>
                        <Border VerticalAlignment="Bottom" Height="7" CornerRadius="0 0 3 3" Background="{StaticResource RibbonGroupButtonBottomBrush}"/>
                        <Image VerticalAlignment="Center" HorizontalAlignment="Center" Source="{TemplateBinding SmallImage}" Stretch="None" Margin="0 0 0 7" Width="16" Height="16"/>
                    </Grid>
                </Border>
                <TextBlock Name="textRow1" Grid.Row="1" Text="{TemplateBinding TextRow1}" TextAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
                <StackPanel Name="DropDownPanel" Grid.Row="2" HorizontalAlignment="Center" Orientation="Horizontal">
                    <TextBlock Name="textRow2" Text="{TemplateBinding TextRow2}" Foreground="{TemplateBinding Foreground}"/>
                    <Path
                            Name="DropDownIndicator"
                            IsHitTestVisible="False"
                            Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                            Margin="2"
                            VerticalAlignment="Top"
                            HorizontalAlignment="Center"
                            Fill="{StaticResource RibbonButtonDropDownFill}"
                            Data="M0,0 L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z"
                            SnapsToDevicePixels="True"/>
                </StackPanel>
            </Grid>
            <Popup x:Name="DropDownPopup"
                    AllowsTransparency="True"
                    StaysOpen="False"
                    Focusable="False"
                    Placement="Bottom"
                    IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}">
                <Grid>
                    <Border x:Name="DropDownPopupBorder"
                            Padding="0"
                            Margin="0"
                            MinWidth="3"
                            MinHeight="3"
                            Width="{TemplateBinding DropDownWidth}"
                            Height="{TemplateBinding DropDownHeight}"
                            MaxWidth="{TemplateBinding DropDownMaxWidth}"
                            MaxHeight="{TemplateBinding DropDownMaxHeight}"
                            Background="{StaticResource DropDownPopupBackgroundBrush}"
                            BorderBrush="{StaticResource DropDownPopupBorderBrush}"
                            BorderThickness="0">
                        <ContentControl x:Name="DropDownPopupContent"
                                Content="{TemplateBinding DropDownContent}"
                                ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                VerticalContentAlignment="Stretch"
                                DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonGroupDropDownButtonStyle" TargetType="telerikRibbonView:RadRibbonDropDownButton">
        <Setter Property="Template" Value="{StaticResource RadRibbonGroupDropDownButtonTemplate}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="DropDownButtonPosition" Value="Bottom"/>
        <Setter Property="Background" Value="{StaticResource RibbonGroupButtonBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource RibbonGroupButtonBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="3 1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style x:Key="SeparatorStyle" TargetType="telerikRibbonView:Separator">
        <Setter Property="Background" Value="{StaticResource RibbonGroupSeparatorLightBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource RibbonGroupButtonBorderBrush}"/>
        <Setter Property="Width" Value="2"/>
        <Setter Property="BorderThickness" Value="0 0 1 0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Margin" Value="0 5 0 6"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikRibbonView:Separator">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ItemsPanelTemplate x:Key="RadRibbonGroupPanelTemplate">
        <telerikRibbonViewPrimitives:RibbonButtonsPanel/>
    </ItemsPanelTemplate>
    <ControlTemplate x:Key="RadRibbonGroupTemplate" TargetType="telerikRibbonView:RadRibbonGroup">
        <Grid SnapsToDevicePixels="True">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="SizeState">
                    <VisualState x:Name="Expanded"/>
                    <VisualState x:Name="Collapsed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CollapsedButton" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CollapsedGroup">
                    <VisualState x:Name="CollapsedGroupNormal"/>
                    <VisualState x:Name="CollapsedGroupPushed"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <telerikRibbonViewPrimitives:GroupChrome x:Name="ExpandedChrome"
                    Foreground="{TemplateBinding Foreground}"
                    DialogLauncherCommand="{TemplateBinding DialogLauncherCommand}"
                    DialogLauncherCommandParameter="{TemplateBinding DialogLauncherCommandParameter}"
                    DialogLauncherCommandTarget="{TemplateBinding DialogLauncherCommandTarget}"
                    Header="{TemplateBinding Header}"
                    HeaderTemplate="{TemplateBinding HeaderTemplate}"
                    DialogLauncherVisibility="{TemplateBinding DialogLauncherVisibility}"
                    IsTabStop="False"
                    HeaderStringFormat="{TemplateBinding HeaderStringFormat}"
                    Margin="0 0 -1 0">
                <ItemsPresenter Name="ItemsPresenter"/>
            </telerikRibbonViewPrimitives:GroupChrome>
            <telerikRibbonView:RadRibbonDropDownButton x:Name="CollapsedButton"
                    Visibility="Collapsed"
                    Style="{StaticResource RadRibbonGroupDropDownButtonStyle}"
                    SplitText="False"
                    SmallImage="{TemplateBinding Icon}"
                    Size="Large"
                    Text="{TemplateBinding Header}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonGroupStyle" TargetType="telerikRibbonView:RadRibbonGroup">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonForegroundBrush}"/>
        <Setter Property="SeparatorStyle" Value="{StaticResource SeparatorStyle}"/>
        <Setter Property="ItemsPanel" Value="{StaticResource RadRibbonGroupPanelTemplate}"/>
        <Setter Property="Icon">
            <Setter.Value>
                <BitmapImage UriSource="pack://application:,,,/Telerik.Windows.Controls.RibbonView;component/RibbonGroupCollapsedIcon.png"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" Value="{StaticResource RadRibbonGroupTemplate}"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonGroup" BasedOn="{StaticResource RadRibbonGroupStyle}"/>
    <ControlTemplate x:Key="ApplicationRibbonButtonTemplate" TargetType="telerikRibbonView:RadRibbonButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBorder}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBorder}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard Duration="0">
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Disabled" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused"/>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="TextAlignment">
                    <VisualState x:Name="TextHide">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="ButtonBackground"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="1"/>
            <Grid Margin="{TemplateBinding Padding}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter x:Name="Content"
                        Margin="{TemplateBinding Padding}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        RecognizesAccessKey="True"
                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                        ContentStringFormat="{TemplateBinding ContentStringFormat}"
                        Grid.ColumnSpan="2"/>
                <Image x:Name="Image"/>
                <TextBlock x:Name="textRow1" Grid.Column="1" Text="{TemplateBinding Text}" TextAlignment="Left" VerticalAlignment="Center" Margin="4 0 1 0"/>
            </Grid>
            <Rectangle x:Name="Background_Disabled" Visibility="Collapsed" Fill="#99FFFFFF"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ApplicationRibbonButton" TargetType="telerikRibbonView:RadRibbonButton">
        <Setter Property="Padding" Value="5"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Size" Value="Large"/>
        <Setter Property="Template" Value="{StaticResource ApplicationRibbonButtonTemplate}"/>
    </Style>
    <ControlTemplate x:Key="ApplicationRibbonDropDownButtonTemplate" TargetType="telerikRibbonView:RadRibbonDropDownButton">
        <Grid SnapsToDevicePixels="True">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBorder}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBorder}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard Duration="0">
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Disabled" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused"/>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="TextAlignment">
                    <VisualState x:Name="TextHide">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textRow1" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="IsOpenState">
                    <VisualState x:Name="Closed"/>
                    <VisualState x:Name="Opened">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="isOpenIndicator" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SplitState"/>
                <VisualStateGroup x:Name="DropDownContentStates">
                    <VisualState x:Name="HasDropDownContent"/>
                    <VisualState x:Name="WithoutDropDownContent">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DropDownPanel">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="ButtonBackground"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="1"/>
            <Border x:Name="isOpenIndicator"
                    Visibility="Collapsed"
                    CornerRadius="1"
                    BorderThickness="1"
                    BorderBrush="{StaticResource ApplicationRibbonButtonOverBorder}"
                    Background="{StaticResource ApplicationRibbonButtonOverBackground}"/>
            <Grid Margin="{TemplateBinding Padding}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="24"/>
                </Grid.ColumnDefinitions>
                <ContentControl
                        Grid.ColumnSpan="3"
                        x:Name="ContentPresenter"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"/>
                <Image x:Name="Image"/>
                <TextBlock x:Name="textRow1" Grid.Column="1" Text="{TemplateBinding Text}" TextAlignment="Left" VerticalAlignment="Center" Margin="4 0 1 0"/>
                <Grid x:Name="DropDownPanel" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="2 0 0 0">
                    <Path x:Name="DropDownIndicator"
                            Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                            Fill="{StaticResource RibbonButtonDropDownArrow}"
                            Data="M 0,0 L 3.5,3.5 L 0,7"
                            Stroke="{StaticResource RibbonButtonDropDownArrowBorder}"/>
                </Grid>
            </Grid>
            <Popup x:Name="DropDownPopup"
                    HorizontalOffset="1"
                    VerticalOffset="-1"
                    AllowsTransparency="True"
                    StaysOpen="False"
                    Focusable="False"
                    Placement="Bottom"
                    IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}">
                <Grid>
                    <Border x:Name="DropDownPopupBorder"
                            Width="{TemplateBinding DropDownWidth}"
                            Height="{TemplateBinding DropDownHeight}"
                            Background="{StaticResource DropDownPopupBackgroundBrush}"
                            BorderBrush="{StaticResource DropDownPopupBorderBrush}"
                            BorderThickness="1">
                        <ContentControl x:Name="DropDownPopupContent" Content="{TemplateBinding DropDownContent}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                    </Border>
                </Grid>
            </Popup>
            <Rectangle x:Name="Background_Disabled" Visibility="Collapsed" Fill="#99FFFFFF"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ApplicationRibbonDropDownButton" TargetType="telerikRibbonView:RadRibbonDropDownButton">
        <Setter Property="Padding" Value="5"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="AutoOpenDelay" Value="0:0:0.3"/>
        <Setter Property="Template" Value="{StaticResource ApplicationRibbonDropDownButtonTemplate}"/>
    </Style>
    <ControlTemplate x:Key="ApplicationRibbonSplitButtonTemplate" TargetType="telerikRibbonView:RadRibbonSplitButton">
        <Grid SnapsToDevicePixels="True">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="BorderThickness">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="BorderThickness">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Background" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Background" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationRibbonButtonOverBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="mouseOverDecorator" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorPart" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="disabledDecorator" Storyboard.TargetProperty="Opacity" Duration="0" To="0.55"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="disabledDecorator" Storyboard.TargetProperty="Visibility" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="IsOpenState">
                    <VisualState x:Name="Closed"/>
                    <VisualState x:Name="Opened">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Background" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonPressedBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="mouseOverDecorator" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SeparatorPart" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="DropDownContentState">
                    <VisualState x:Name="HasDropDownContent"/>
                    <VisualState x:Name="WithoutDropDownContent">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DropDownPanel">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="backgroundDecorator"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="1"/>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <telerik:RadButton x:Name="ButtonPart"
                        Grid.ColumnSpan="2"
                        Background="Transparent"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        Padding="{TemplateBinding Padding}"/>
                <telerik:RadToggleButton x:Name="DropDownPart"
                        Grid.Column="2"
                        Margin="0"
                        Background="Transparent"
                        Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                        IsTabStop="false"
                        IsChecked="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                <Rectangle x:Name="SeparatorPart"
                        Grid.ColumnSpan="2"
                        MinWidth="1"
                        MinHeight="1"
                        Visibility="Collapsed"
                        IsHitTestVisible="False"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Stretch"
                        Fill="{StaticResource RadRibbonBarDropDownButtonPressedBorder}"/>
                <Image x:Name="Image" IsHitTestVisible="False" Margin="4"/>
                <TextBlock x:Name="textRow1" Grid.Column="1" IsHitTestVisible="False" Text="{TemplateBinding Text}" TextAlignment="Left" VerticalAlignment="Center" Margin="12 11 1 11"/>
                <Grid x:Name="DropDownPanel" Grid.Column="2" Width="22" IsHitTestVisible="False">
                    <Path x:Name="DropDownIndicator"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            IsHitTestVisible="False"
                            Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                            Fill="{StaticResource RibbonButtonDropDownArrow}"
                            Data="M 0,0 L 3.5,3.5 L 0,7"
                            Stroke="{StaticResource RibbonButtonDropDownArrowBorder}"/>
                </Grid>
            </Grid>
            <Border x:Name="mouseOverDecorator"
                    Opacity="0"
                    Background="{x:Null}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"
                    CornerRadius="2"/>
            <Popup x:Name="DropDownPopup"
                    HorizontalOffset="1"
                    VerticalOffset="-1"
                    AllowsTransparency="True"
                    StaysOpen="False"
                    Focusable="False"
                    Placement="Bottom"
                    IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}">
                <Grid>
                    <Border x:Name="DropDownPopupBorder"
                            MinWidth="3"
                            MinHeight="3"
                            Width="{TemplateBinding DropDownWidth}"
                            Height="{TemplateBinding DropDownHeight}"
                            Background="{StaticResource DropDownPopupBackgroundBrush}"
                            BorderBrush="{StaticResource DropDownPopupBorderBrush}"
                            BorderThickness="1">
                        <ContentControl x:Name="DropDownPopupContent" Content="{TemplateBinding DropDownContent}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                    </Border>
                </Grid>
            </Popup>
            <Rectangle x:Name="disabledDecorator" Visibility="Collapsed" Opacity="0" Fill="#FFFFFFFF"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ApplicationRibbonSplitButton" TargetType="telerikRibbonView:RadRibbonSplitButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="AutoOpenDelay" Value="0:0:0.3"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="IsOpen" Value="false"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="DropDownPlacement" Value="Relative"/>
        <Setter Property="Size" Value="Large"/>
        <Setter Property="Template" Value="{StaticResource ApplicationRibbonSplitButtonTemplate}"/>
    </Style>
    <Style x:Key="ApplicationSeparatorStyle" TargetType="telerikRibbonView:Separator">
        <Setter Property="BorderBrush" Value="{StaticResource ApplicationMenu_OuterBorder}"/>
        <Setter Property="Margin" Value="0 1"/>
        <Setter Property="BorderThickness" Value="0 1 0 0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikRibbonView:Separator">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="ApplicationMenuTemplate" TargetType="telerikRibbonView:ApplicationMenu">
        <Grid>
            <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Border x:Name="clippingRectangle" Background="{StaticResource ApplicationMenu_ClippingRectangleFill}" MinHeight="24"/>
                    <Rectangle x:Name="buttonRectangle" HorizontalAlignment="Left" Fill="Transparent" MinHeight="24"/>
                    <Border Grid.Row="1" Background="{StaticResource ApplicationMenuMiddleBorderBrush}">
                        <Border Margin="2 0" BorderThickness="1" BorderBrush="{StaticResource ApplicationMenuContentOuterBorderBrush}"/>
                    </Border>
                    <Border BorderThickness="0 1 0 0" BorderBrush="{StaticResource ApplicationMenu_OuterBorder}" Grid.ColumnSpan="3" VerticalAlignment="Bottom"/>
                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="LeftPane" MinWidth="164" Padding="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 0 1 0">
                            <ItemsPresenter/>
                        </Border>
                        <Border x:Name="RightPane" Visibility="{TemplateBinding RightPaneVisibility}" Grid.Column="1" Background="{TemplateBinding Background}">
                            <ContentPresenter Content="{TemplateBinding Content}" x:Name="ContentPresenter" MinWidth="125"/>
                        </Border>
                    </Grid>
                    <Border Grid.Row="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 1">
                        <ContentPresenter Content="{TemplateBinding FooterContent}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="3"/>
                    </Border>
                </Grid>
            </Border>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ApplicationMenuStyle" TargetType="telerikRibbonView:ApplicationMenu">
        <Setter Property="Template" Value="{StaticResource ApplicationMenuTemplate}"/>
        <Setter Property="Background" Value="{StaticResource ApplicationMenu_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ApplicationMenu_OuterBorder}"/>
        <Setter Property="Foreground" Value="{StaticResource ApplicationMenu_Foreground}"/>
        <Setter Property="BorderThickness" Value="1 0 1 1"/>
        <Setter Property="Margin" Value="0 1 0 0"/>
        <Setter Property="ItemContainerStyleSelector">
            <Setter.Value>
                <telerikRibbonView:CustomContainerStyleSelector>
                    <telerikRibbonView:CustomContainerStyle TypeName="RadRibbonButton" ContainerStyle="{StaticResource ApplicationRibbonButton}"/>
                    <telerikRibbonView:CustomContainerStyle TypeName="RadRibbonDropDownButton" ContainerStyle="{StaticResource ApplicationRibbonDropDownButton}"/>
                    <telerikRibbonView:CustomContainerStyle TypeName="RadRibbonSplitButton" ContainerStyle="{StaticResource ApplicationRibbonSplitButton}"/>
                    <telerikRibbonView:CustomContainerStyle TypeName="Separator" ContainerStyle="{StaticResource ApplicationSeparatorStyle}"/>
                </telerikRibbonView:CustomContainerStyleSelector>
            </Setter.Value>
        </Setter>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="telerikRibbonView:ApplicationMenu" BasedOn="{StaticResource ApplicationMenuStyle}"/>
    <ControlTemplate x:Key="DropShadowTemplate" TargetType="telerikRibbonViewPrimitives:DropShadow">
        <Grid>
            <Rectangle Name="Left" HorizontalAlignment="Left" VerticalAlignment="Stretch" IsHitTestVisible="False"/>
            <Rectangle Name="TopLeft" HorizontalAlignment="Left" VerticalAlignment="Top" IsHitTestVisible="False"/>
            <Rectangle Name="Top" HorizontalAlignment="Stretch" VerticalAlignment="Top" IsHitTestVisible="False"/>
            <Rectangle Name="TopRight" HorizontalAlignment="Right" VerticalAlignment="Top" IsHitTestVisible="False"/>
            <Rectangle Name="Right" HorizontalAlignment="Right" VerticalAlignment="Stretch" IsHitTestVisible="False"/>
            <Rectangle Name="BottomRight" HorizontalAlignment="Right" VerticalAlignment="Bottom" IsHitTestVisible="False"/>
            <Rectangle Name="Bottom" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" IsHitTestVisible="False"/>
            <Rectangle Name="BottomLeft" HorizontalAlignment="Left" VerticalAlignment="Bottom" IsHitTestVisible="False"/>
            <ContentPresenter
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    Margin="{TemplateBinding Padding}"/>
        </Grid>
    </ControlTemplate>
    <Style TargetType="telerikRibbonViewPrimitives:DropShadow" x:Key="DropShadowStyle">
        <Setter Property="Template" Value="{StaticResource DropShadowTemplate}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <ControlTemplate x:Key="KeyTipControlTemplate" TargetType="telerikKeyTips:KeyTipControl">
        <Grid>
            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1">
                <Border BorderThickness="1" BorderBrush="{StaticResource RibbonBarKeyTips_InnerBorderBrush}"/>
            </Border>
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="KeyTipControlStyle" TargetType="telerikKeyTips:KeyTipControl">
        <Setter Property="Template" Value="{StaticResource KeyTipControlTemplate}"/>
        <Setter Property="Background" Value="{StaticResource RibbonBarKeyTips_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource RibbonBarKeyTips_OuterBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="2 -2 2 -1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinWidth" Value="16"/>
        <Setter Property="MinHeight" Value="16"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <ControlTemplate x:Key="ScreenTipTemplate" TargetType="telerikRibbonView:ScreenTip">
        <Grid x:Name="RootElement">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="ContentState">
                    <VisualState x:Name="Title">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Width">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Double>210</sys:Double>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="TitleDescription">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DescriptionPresenter" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Width">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Double>210</sys:Double>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="TitleDescriptionImage">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DescriptionPresenter" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Image" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Width">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <sys:Double>318</sys:Double>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                <Grid Margin="{TemplateBinding Padding}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock x:Name="TitlePresenter" Grid.ColumnSpan="2" Text="{TemplateBinding Title}" Margin="0 0 0 5" TextWrapping="Wrap" FontWeight="Bold"/>
                    <Image x:Name="Image" Grid.Row="1" Source="{TemplateBinding Icon}" Stretch="None" Margin="0 5 10 6" VerticalAlignment="Top" Visibility="Collapsed"/>
                    <TextBlock x:Name="DescriptionPresenter"
                            Grid.Row="1"
                            Grid.Column="1"
                            TextWrapping="Wrap"
                            FontWeight="Normal"
                            Text="{TemplateBinding Description}"
                            VerticalAlignment="Top"
                            Visibility="Collapsed"/>
                </Grid>
            </Border>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ScreenTipStyle" TargetType="telerikRibbonView:ScreenTip">
        <Setter Property="Template" Value="{StaticResource ScreenTipTemplate}"/>
        <Setter Property="Background" Value="{StaticResource QuickAccessKeyHintBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource QuickAccessKeyHintBorderBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource QuickAccessKeyHintForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="4 2"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style x:Key="RibbonScrollViewerPathStyle" TargetType="Path">
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Fill" Value="{StaticResource PageScrollViewerButtonForegroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <ControlTemplate x:Key="RibbonScrollButtonTemplate" TargetType="RepeatButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PageScrollViewerHotButtonBackgroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="BorderBrush">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonHoverOuterBorderBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PageScrollViewerPressedButtonBackgroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="OuterBorder"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="3 0 0 3"/>
            <Path x:Name="Path"
                    Style="{StaticResource RibbonScrollViewerPathStyle}"
                    Fill="{StaticResource PageScrollViewerButtonForegroundBrush}"
                    Data="F1M3,0L3,5 0,2.5 3,0z"
                    SnapsToDevicePixels="True"
                    FocusVisualStyle="{x:Null}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RibbonScrollButtonStyle" TargetType="RepeatButton">
        <Setter Property="Template" Value="{StaticResource RibbonScrollButtonTemplate}"/>
        <Setter Property="Background" Value="{StaticResource PageScrollViewerButtonBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource PageScrollViewerButtonOuterBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Width" Value="12"/>
        <Setter Property="Interval" Value="50"/>
    </Style>
    <ControlTemplate x:Key="RibbonScrollViewerTemplate" TargetType="telerikRibbonViewPrimitives:RibbonScrollViewer">
        <Grid>
            <ContentPresenter x:Name="Content" Margin="1 0 1 0"/>
            <Grid x:Name="ButtonsGrid" HorizontalAlignment="Left">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <RepeatButton x:Name="LeftScrollButtonElement" Style="{StaticResource RibbonScrollButtonStyle}"/>
                <RepeatButton x:Name="RightScrollButtonElement" RenderTransformOrigin="0.5 0.5" Grid.Column="2" Style="{StaticResource RibbonScrollButtonStyle}">
                    <RepeatButton.RenderTransform>
                        <ScaleTransform ScaleX="-1"/>
                    </RepeatButton.RenderTransform>
                </RepeatButton>
            </Grid>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RibbonScrollViewerStyle" TargetType="telerikRibbonViewPrimitives:RibbonScrollViewer">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template" Value="{StaticResource RibbonScrollViewerTemplate}"/>
    </Style>
    <Style TargetType="telerikRibbonViewPrimitives:DropShadow" BasedOn="{StaticResource DropShadowStyle}"/>
    <Style TargetType="telerikKeyTips:KeyTipControl" BasedOn="{StaticResource KeyTipControlStyle}"/>
    <Style TargetType="telerikRibbonView:ScreenTip" BasedOn="{StaticResource ScreenTipStyle}"/>
    <Style TargetType="telerikRibbonViewPrimitives:RibbonScrollViewer" BasedOn="{StaticResource RibbonScrollViewerStyle}"/>
    <ControlTemplate x:Key="RadRibbonBackstageItemTemplate" TargetType="telerikRibbonView:RadRibbonBackstageItem">
        <Grid x:Name="wrapper" Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Background" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonnBackStage_Item_BackgroundMouseOVer}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="BorderBrush" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonnBackStage_Item_OuterBorderMouseOVer}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentPanel" To="0.5" Duration="0:0:0.1"/>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="OuterBorder" To="0" Duration="0:0:0.1"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ButtonStates">
                    <VisualState x:Name="ButtonNormal">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPanel" Storyboard.TargetProperty="Margin" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>20 5</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="ButtonMouseLeave"/>
                    <VisualState x:Name="ButtonMouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPanel" Storyboard.TargetProperty="Margin" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>20 5</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Margin" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>5 0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="BorderThickness" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>1</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="BorderBrush" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonnBackStage_Item_OuterBorderMouseOVer}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Background" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonnBackStage_Item_BackgroundMouseOVer}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="TabItemStates">
                    <VisualState x:Name="TabItemUnSelected"/>
                    <VisualState x:Name="TabItemSelected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedVisualState" Storyboard.TargetProperty="Visibility" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="Visibility" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderElement" Storyboard.TargetProperty="Foreground" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonBackstage_Item_ForegroundSelected}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="TabItemMouseOver"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="0 1" Margin="0 0 1 0"/>
            <Grid x:Name="SelectedVisualState" Visibility="Collapsed">
                <Rectangle Fill="{StaticResource RibbonnBackStage_Item_OuterBackgroundSelected}" Stroke="{StaticResource RibbonnBackStage_Item_OuterBorderSelected}"/>
                <Border BorderThickness="0" Margin="0 0 0 -1" Background="{StaticResource RibbonnBackStage_Item_InnerBackgroundSelected}">
                    <Rectangle Fill="{StaticResource RibbonnBackStage_Item_InnerBorderSelected}"/>
                </Border>
            </Grid>
            <StackPanel Orientation="Horizontal" x:Name="ContentPanel" Margin="20 10">
                <Image x:Name="Image" Source="{TemplateBinding Icon}" MaxWidth="16" MaxHeight="16" Stretch="Fill" Margin="0 0 5 0" Visibility="Collapsed"/>
                <ContentControl x:Name="HeaderElement"
                        Content="{TemplateBinding Header}"
                        IsTabStop="False"
                        Foreground="{TemplateBinding HeaderForeground}"
                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                        SnapsToDevicePixels="True"
                        ContentStringFormat="{TemplateBinding HeaderStringFormat}"/>
            </StackPanel>
            <Path
                    Name="path"
                    Data="M129.5,9.2 L129.5,24.2 L121.5,16.4 z"
                    Fill="{StaticResource RibbonnBackStage_ArrowBackground}"
                    HorizontalAlignment="Right"
                    Height="15"
                    Margin="0 0 -1 0"
                    StrokeStartLineCap="Flat"
                    Stretch="Fill"
                    StrokeEndLineCap="Flat"
                    StrokeThickness="1"
                    StrokeMiterLimit="10"
                    StrokeLineJoin="Miter"
                    VerticalAlignment="Center"
                    Width="8"
                    Visibility="Collapsed"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonBackstageItemStyle" TargetType="telerikRibbonView:RadRibbonBackstageItem">
        <Setter Property="Template" Value="{StaticResource RadRibbonBackstageItemTemplate}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonBackstage_Item_Foreground}"/>
        <Setter Property="HeaderForeground" Value="{StaticResource RibbonBackstage_Item_HeaderForeground}"/>
        <Setter Property="Margin" Value="0 1"/>
        <Setter Property="MinWidth" Value="5"/>
        <Setter Property="MinHeight" Value="5"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <ControlTemplate x:Key="TabControlTemplate" TargetType="telerikNavigation:RadTabControl">
        <ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" Padding="-1">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Border Grid.ColumnSpan="2" Background="{StaticResource RibbonnBackStage_TopLine}" Height="2"/>
                <Grid Grid.Row="1">
                    <Border x:Name="HeaderBackground"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding HeaderBackground}"
                            Visibility="{TemplateBinding BackgroundVisibility}"/>
                    <Border BorderThickness="0 0 1 0" HorizontalAlignment="Right" Background="{StaticResource RibbonnBackStage_BorderBrushRight}" Width="5" SnapsToDevicePixels="True"/>
                    <ItemsPresenter x:Name="ItemsPresenter" Margin="0 4 0 0"/>
                </Grid>
                <Grid x:Name="ContentBorder" Grid.Column="1" Grid.Row="1" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}">
                    <Grid x:Name="Corner_Offices" Height="163" Margin="0 0 0 -4" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="363">
                        <Rectangle Margin="38 0 1 5" Height="158" Fill="{StaticResource RibbonnBackStage_CornerBackground}"/>
                        <Path
                                Fill="{StaticResource RibbonnBackStage_CornerPath1}"
                                Margin="49.99,0.296,0.553,4.703"
                                Stretch="Fill"
                                Data="M1123.5387,485.33307 C1123.5387,485.33307 1095.134,532.02374 999.00061,582.00073 C962.78992,600.82568 924.71429,614.0885 924.71429,614.0885 C924.71429,614.0885 841.09241,640.33337 811.10925,642.76489 C807.72156,643.03961 1123.3203,643.33423 1123.3203,643.33423 z"/>
                        <Path
                                Fill="{StaticResource RibbonnBackStage_CornerPath2}"
                                Margin="72.005,31.979,0.771,4.488"
                                Stretch="Fill"
                                StrokeThickness="2"
                                Data="M1123.2728,516.80042 C1123.2728,516.80042 1077.7751,561.80066 1000.5497,595.66058 C963.17285,612.04865 920.97644,624.45093 920.97644,624.45093 C920.97644,624.45093 863.08844,639.87512 833.10913,642.76489 C831.05566,642.96283 1123.3203,643.33423 1123.3203,643.33423 z"/>
                        <Path
                                Fill="{StaticResource RibbonnBackStage_CornerPath3}"
                                Margin="71.332,61.012,0.553,4.551"
                                Stretch="Fill"
                                Data="M1123.5387,525.33331 C1123.5387,525.33331 1077.2158,571.32648 1001.8666,601.20764 C963.92914,616.2525 920.68646,627.9986 920.68646,627.9986 C920.68646,627.9986 863.00067,637.68988 833.10913,641.37885 C816.06982,643.48169 1123.3755,643.06439 1123.3755,643.06439 z"/>
                        <Path
                                Fill="{StaticResource RibbonnBackStage_CornerPath4}"
                                Margin="73.735,55.826,31.706,-0.386"
                                Stretch="Fill"
                                Stroke="{x:Null}"
                                RenderTransformOrigin="0.5,0.5"
                                Data="M-367.12283,642.90454 C-367.63965,642.07587 -197.59694,596.60883 -109.59438,535.38568 C-107.99017,534.26965 -176.02165,607.07281 -307.60947,639.71875 C-308.53998,639.94958 -366.92459,643.22241 -367.12283,642.90454 z">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <RotateTransform Angle="3.249"/>
                                    <TranslateTransform X="-1.0058153432702834" Y="1.8080198244160259"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                        <Path
                                Stroke="{StaticResource RibbonnBackStage_CornerPath5}"
                                Margin="64,43.184,-0.091,4.846"
                                Stretch="Fill"
                                StrokeThickness="2"
                                Data="M-342.01355,643.15387 C-342.01355,643.15387 -246.18782,633.41809 -139.82617,585.00433 C-84.559242,559.8479 -45.132977,530.28394 -42.905621,528.20294"/>
                        <Path
                                Fill="{StaticResource RibbonnBackStage_CornerPath6}"
                                Height="75.5"
                                Margin="39.686,0,118.499,4.821"
                                Stretch="Fill"
                                Stroke="{x:Null}"
                                VerticalAlignment="Bottom"
                                Data="M-358.99686,643.23138 C-363.04657,642.54706 -233.95364,602.56274 -154.29437,567.93054 C-152.50218,567.15137 -255.679,633.41669 -345.54379,642.16193 C-346.49802,642.25476 -354.5575,643.98157 -358.99686,643.23138 z"/>
                        <Path
                                Fill="{StaticResource RibbonnBackStage_CornerPath7}"
                                Height="72.575"
                                Margin="48.71,0,121.855,5.269"
                                Stretch="Fill"
                                Stroke="{x:Null}"
                                VerticalAlignment="Bottom"
                                Data="M-358.99686,641.97211 C-362.3956,642.15503 -239.45111,609.26654 -166.6651,569.41693 C-164.95096,568.47845 -223.40971,611.79913 -345.54379,640.90265 C-346.47641,641.12488 -354.50107,641.7301 -358.99686,641.97211 z"/>
                    </Grid>
                    <ContentPresenter x:Name="ContentElement"
                            Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsContentPreserved, Converter={StaticResource InvertBoolToVisConverter}}"
                            ContentTemplate="{TemplateBinding SelectedContentTemplate}"
                            ContentTemplateSelector="{TemplateBinding SelectedContentTemplateSelector}"/>
                    <Grid x:Name="ContentElementsPanel" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsContentPreserved, Converter={StaticResource RibbonBooleanToVisibilityConverter}}"/>
                </Grid>
            </Grid>
        </ScrollViewer>
    </ControlTemplate>
    <Style x:Key="BackstageGroupSeparator" TargetType="telerikRibbonView:RadRibbonBackstageItem">
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikRibbonView:RadRibbonBackstageItem">
                    <StackPanel>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentPanel" To="0.5" Duration="0:0:0.1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="ContentPanel" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Margin="20 5 0 5" VerticalAlignment="Center"/>
                        <Rectangle Height="1" Margin="18 0 10 4" Fill="{StaticResource RibbonnBackStage_DottedLineBrush}"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadRibbonBackstageStyle" TargetType="telerikRibbonView:RadRibbonBackstage">
        <Setter Property="FocusManager.IsFocusScope" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle"/>
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Contained"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Align" Value="Right"/>
        <Setter Property="TabStripPlacement" Value="Left"/>
        <Setter Property="TabOrientation" Value="Vertical"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Background" Value="{StaticResource RibbonnBackStage_BackgroundContent}"/>
        <Setter Property="HeaderBackground" Value="{StaticResource RibbonnBackStage_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource RibbonnBackStage_BorderBrush}"/>
        <Setter Property="BorderThickness" Value="0 0 1 0"/>
        <Setter Property="ItemContainerStyleSelector">
            <Setter.Value>
                <telerikRibbonView:BackstageContainerStyleSelector>
                    <telerikRibbonView:BackstageContainerStyle ContainerStyle="{StaticResource BackstageGroupSeparator}"/>
                </telerikRibbonView:BackstageContainerStyleSelector>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel MinWidth="130"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" Value="{StaticResource TabControlTemplate}"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonBackstage" BasedOn="{StaticResource RadRibbonBackstageStyle}"/>
    <Style TargetType="telerikRibbonView:RadRibbonBackstageItem" BasedOn="{StaticResource RadRibbonBackstageItemStyle}"/>
    <ControlTemplate x:Key="RadRibbonTabTemplate" TargetType="telerikRibbonView:RadRibbonTab">
        <Grid x:Name="RootPanel">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="EnabledStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="HeaderElement" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Enabled"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="NotSelected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ContextualTabStates">
                    <VisualState x:Name="NotContextualTab">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderPanel" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="ActiveContextualTab">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderPanel" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="InactiveContextualTab">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderPanel" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="KeyboardNavigationVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="TabSeparator" Margin="0 0 -3 0" HorizontalAlignment="Right" Fill="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="1" Visibility="Collapsed"/>
            <Grid x:Name="HeaderPanel" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HeaderVisibility, Mode=TwoWay}">
                <Border Background="{TemplateBinding Background}"/>
                <Border x:Name="Background_Over"
                        Visibility="Collapsed"
                        Background="{StaticResource TabMouseOverBackground}"
                        BorderBrush="{StaticResource TabMouseOverOuterBorder}"
                        BorderThickness="1 1 1 0"
                        CornerRadius="3 3 0 0"/>
                <Border x:Name="Background_Selected"
                        BorderThickness="1 1 1 0"
                        Visibility="Collapsed"
                        Background="{StaticResource TabSelectedBackground}"
                        BorderBrush="{StaticResource TabSelectedOuterBorder}"
                        CornerRadius="3 3 0 0"/>
                <Border x:Name="KeyboardNavigationVisual"
                        BorderThickness="1 1 1 0"
                        Opacity="0"
                        Background="{StaticResource TabMouseOverBackground}"
                        BorderBrush="{StaticResource TabMouseOverOuterBorder}"
                        CornerRadius="3 3 0 0"/>
                <ContentControl x:Name="HeaderElement"
                        Content="{TemplateBinding Header}"
                        IsTabStop="False"
                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                        Foreground="{TemplateBinding Foreground}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        Margin="{TemplateBinding Padding}"
                        ContentStringFormat="{TemplateBinding HeaderStringFormat}"
                        ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"/>
            </Grid>
            <Grid x:Name="ContentPanel" Width="0" Height="0">
                <Border
                        Name="OuterBorder"
                        BorderThickness="1"
                        Background="{StaticResource RibbonTabBackgroundBrush}"
                        BorderBrush="{StaticResource RibbonTabOuterBorderBrush}"
                        CornerRadius="{StaticResource RibbonTabOuterCornerRadius}">
                    <Border Name="InnerBorder" CornerRadius="{StaticResource RibbonTabInnerCornerRadius}" BorderThickness="1" BorderBrush="{StaticResource RibbonTabInnerBorderBrush}"/>
                </Border>
                <telerikRibbonViewPrimitives:RibbonScrollViewer x:Name="TabItemsScrollViewer">
                    <ItemsPresenter HorizontalAlignment="Left" Margin="2"/>
                </telerikRibbonViewPrimitives:RibbonScrollViewer>
            </Grid>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadRibbonTabStyle" TargetType="telerikRibbonView:RadRibbonTab">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{StaticResource TabStripTabNormalForegroundBrush}"/>
        <Setter Property="Padding" Value="13 4 13 5"/>
        <Setter Property="BorderThickness" Value="1 0 0 0"/>
        <Setter Property="Margin" Value="0 0 3 0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style TargetType="Control">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" Value="{StaticResource RadRibbonTabTemplate}"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <telerikRibbonViewPrimitives:RibbonGroupsPanel/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonTab" BasedOn="{StaticResource RadRibbonTabStyle}"/>
    <ControlTemplate x:Key="ContextualTabsTemplate" TargetType="telerikRibbonView:RadRibbonTab">
        <Grid x:Name="RootPanel">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="EnabledStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="HeaderElement" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Enabled"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="NotSelected">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ContextualTabStates">
                    <VisualState x:Name="NotContextualTab">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderPanel" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="ActiveContextualTab">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderPanel" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="InactiveContextualTab">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderPanel" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ContextualGroupStates">
                    <VisualState x:Name="DefaultContextualGroupTab"/>
                    <VisualState x:Name="IsSingleTabInContextualGroup">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContextualGroupRightBorder" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContextualGroupLeftBorder" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="IsLastTabInContextualGroup">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContextualGroupRightBorder" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Over" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Background_Selected" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="KeyboardNavigationVisual" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="IsFirstTabInContextualGroup">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContextualGroupLeftBorder" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="KeyboardNavigationVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="TabSeparator" Visibility="Collapsed" Margin="0 0 -3 0" HorizontalAlignment="Right" Fill="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="1"/>
            <Grid x:Name="HeaderPanel" Background="Transparent" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HeaderVisibility, Mode=TwoWay}">
                <Border Background="{TemplateBinding Background}">
                    <Border.OpacityMask>
                        <RadialGradientBrush Center="0.5,1" GradientOrigin="0.5,1" RadiusX="1" RadiusY="1">
                            <GradientStop Offset="1" Color="#4D000000"/>
                            <GradientStop Color="#80FFFFFF" Offset="0.19"/>
                        </RadialGradientBrush>
                    </Border.OpacityMask>
                </Border>
                <Border x:Name="Background_Over" Visibility="Collapsed" Margin="0 0 3 0" BorderBrush="{TemplateBinding Background}" BorderThickness="1 1 1 0" CornerRadius="2 2 0 0"/>
                <Border x:Name="Background_Selected" Visibility="Collapsed" Margin="0 0 3 0" BorderBrush="#FF707070" Background="#FF2D2E32" BorderThickness="1 1 1 0" CornerRadius="2 2 0 0"/>
                <Border x:Name="KeyboardNavigationVisual"
                        BorderThickness="1 1 1 0"
                        Margin="0 0 3 0"
                        Opacity="0"
                        Background="{StaticResource TabMouseOverBackground}"
                        BorderBrush="{StaticResource TabMouseOverOuterBorder}"
                        CornerRadius="3 3 0 0"/>
                <Border BorderThickness="1 0 0 0" x:Name="ContextualGroupLeftBorder" Grid.ColumnSpan="2" Visibility="Collapsed" BorderBrush="Black" Margin="0 0 0 0">
                    <Border.OpacityMask>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#A5FFFFFF" Offset="0"/>
                            <GradientStop Color="#4CFFFFFF" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.OpacityMask>
                </Border>
                <Border BorderThickness="0 0 1 0" x:Name="ContextualGroupRightBorder" Grid.ColumnSpan="2" BorderBrush="Black" Visibility="Collapsed" Margin="0 0 0 0">
                    <Border.OpacityMask>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#A5FFFFFF" Offset="0"/>
                            <GradientStop Color="#4CFFFFFF" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.OpacityMask>
                </Border>
                <ContentControl x:Name="HeaderElement"
                        Content="{TemplateBinding Header}"
                        IsTabStop="False"
                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                        Foreground="{TemplateBinding Foreground}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        Margin="{TemplateBinding Padding}"
                        ContentStringFormat="{TemplateBinding HeaderStringFormat}"
                        ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"/>
            </Grid>
            <Grid x:Name="ContentPanel" Width="0" Height="0">
                <Border
                        Name="OuterBorder"
                        BorderThickness="1"
                        Background="{StaticResource RibbonTabBackgroundBrush}"
                        BorderBrush="{TemplateBinding Background}"
                        CornerRadius="{StaticResource RibbonTabOuterCornerRadius}">
                    <telerikRibbonViewPrimitives:RibbonScrollViewer x:Name="TabItemsScrollViewer">
                        <ItemsPresenter HorizontalAlignment="Left"/>
                    </telerikRibbonViewPrimitives:RibbonScrollViewer>
                </Border>
            </Grid>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ContextualTabsStyle" TargetType="telerikRibbonView:RadRibbonTab">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style TargetType="Control">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{StaticResource TabStripTabNormalForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="1 0 0 0"/>
        <Setter Property="Padding" Value="13 4"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <telerikRibbonViewPrimitives:RibbonGroupsPanel/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" Value="{StaticResource ContextualTabsTemplate}"/>
    </Style>
    <ControlTemplate x:Key="ContextualGroupsTemplate" TargetType="telerikRibbonView:RadRibbonContextualGroup">
        <Grid x:Name="HeaderGrid" Background="Transparent" Margin="0">
            <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding Color}"/>
            <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" Opacity="0.5"/>
            <Border Background="{TemplateBinding Color}" BorderThickness="1 0">
                <Border.OpacityMask>
                    <RadialGradientBrush Center="0.5,1.136" GradientOrigin="0.5,1.136" RadiusX="0.736" RadiusY="0.895">
                        <GradientStop Offset="1" Color="#4D000000"/>
                        <GradientStop Color="#80FFFFFF" Offset="0.19"/>
                    </RadialGradientBrush>
                </Border.OpacityMask>
            </Border>
            <ContentControl
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    IsTabStop="False"
                    Content="{TemplateBinding Header}"
                    FontSize="{TemplateBinding FontSize}"
                    HorizontalAlignment="{TemplateBinding HeaderAlignment}"
                    Margin="{TemplateBinding Padding}"
                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                    Foreground="{TemplateBinding Foreground}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ContextualGroupsStyle" TargetType="telerikRibbonView:RadRibbonContextualGroup">
        <Setter Property="Margin" Value="0 0 3 0"/>
        <Setter Property="Foreground" Value="{StaticResource ContextualGroup_Foreground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ContextualGroup_BorderBrush}"/>
        <Setter Property="BorderThickness" Value="0 2 0 0"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="HeaderAlignment" Value="Center"/>
        <Setter Property="Padding" Value="5 5 5 2"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template" Value="{StaticResource ContextualGroupsTemplate}"/>
    </Style>
    <ControlTemplate x:Key="OverflowMenuItemTemplate" TargetType="telerikNavigation:RadMenuItem">
        <ContentPresenter Margin="30 0 0 0" Content="{TemplateBinding Header}"/>
    </ControlTemplate>
    <ControlTemplate x:Key="QuickAccessToolBarTemplate" TargetType="telerikRibbonView:QuickAccessToolBar">
        <Grid x:Name="RootElement">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStateGroup">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RootElement" To="0.5" Duration="0:0:0.2"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="HostingState">
                    <VisualState x:Name="NotHosted"/>
                    <VisualState x:Name="HostedAboveRibbon"/>
                    <VisualState x:Name="HostedBelowRibbon">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="AboveBackgroundGrid" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BelowBackgroundGrid" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_StripPanel" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>2 2 0 2</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TogglePositionMenuItem" Storyboard.TargetProperty="Header">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:LocalizableResource Key=RibbonViewQATShowAbove}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="MinimizeStates">
                    <VisualState x:Name="NotMinimized"/>
                    <VisualState x:Name="Minimized">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MinimizeMenuItem" Storyboard.TargetProperty="Header">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:LocalizableResource Key=RibbonViewQATRestore}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid x:Name="BelowBackgroundGrid" Grid.ColumnSpan="3" Visibility="Collapsed">
                <Border Background="{TemplateBinding Background}" BorderThickness="1" CornerRadius="2 2 0 0" Margin="1 1 0 0"/>
                <Border BorderThickness="1" CornerRadius="2 2 0 0" BorderBrush="{TemplateBinding BorderBrush}" Margin="0 0 1 1"/>
            </Grid>
            <Grid x:Name="AboveBackgroundGridWrapper">
                <Grid x:Name="AboveBackgroundGrid"/>
            </Grid>
            <telerikToolBar:RadToolBarPanel x:Name="PART_StripPanel" Margin="3 0 0 0" Orientation="Horizontal"/>
            <telerikRibbonView:RadRibbonDropDownButton x:Name="DropDownButton"
                    MinWidth="0"
                    Visibility="{TemplateBinding CustomizationMenuVisibility}"
                    DropDownIndicatorVisibility="Collapsed"
                    IsOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsOverflowOpen, Mode=TwoWay}"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Grid.Column="1"
                    VerticalContentAlignment="Center"
                    Width="15"
                    Height="22"
                    Padding="0 2">
                <ToolTipService.ToolTip>
                    <TextBlock Text="{telerik:LocalizableResource Key=RibbonViewQATCustomize}"/>
                </ToolTipService.ToolTip>
                <telerikRibbonView:RadRibbonDropDownButton.DropDownContent>
                    <StackPanel>
                        <telerikRibbonView:RadGroupHeader IsTabStop="False" Content="{telerik:LocalizableResource Key=RibbonViewQATCustomize}"/>
                        <telerikNavigation:RadMenuItem SubmenuItemTemplateKey="{StaticResource OverflowMenuItemTemplate}" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HasOverflowItems, Converter={StaticResource RibbonBooleanToVisibilityConverter}}" Foreground="{TemplateBinding Foreground}">
                            <telerikNavigation:RadMenuItem.Header>
                                <telerikToolBar:RadToolBarPanel x:Name="PART_OverflowPanel" Orientation="Vertical" VerticalAlignment="Top"/>
                            </telerikNavigation:RadMenuItem.Header>
                        </telerikNavigation:RadMenuItem>
                        <telerikNavigation:RadMenuItem
                                IsSeparator="True"
                                Padding="0"
                                Margin="0"
                                MinHeight="0"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HasOverflowItems, Converter={StaticResource RibbonBooleanToVisibilityConverter}}"
                                Foreground="{TemplateBinding Foreground}"/>
                        <telerikNavigation:RadMenuItem x:Name="TogglePositionMenuItem"
                                Header="{telerik:LocalizableResource Key=RibbonViewQATShowBelow}"
                                Foreground="{TemplateBinding Foreground}"
                                Command="{x:Static telerikRibbonView:RibbonCommands.ToggleQATPositionCommand}"/>
                        <telerikNavigation:RadMenuItem IsSeparator="True" Padding="0" Margin="0" MinHeight="0"/>
                        <telerikNavigation:RadMenuItem x:Name="MinimizeMenuItem"
                                Header="{telerik:LocalizableResource Key=RibbonViewQATMinimize}"
                                Foreground="{TemplateBinding Foreground}"
                                Command="{x:Static telerikRibbonView:RibbonCommands.MinimizeRibbonCommand}"/>
                    </StackPanel>
                </telerikRibbonView:RadRibbonDropDownButton.DropDownContent>
                <Grid>
                    <Path
                            Stroke="{x:Null}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Data="M0,3 L5,3 5,4 4,4 4,5 3,5 3,6 2,6 2,5 1,5 1,4 0,4 z M0,0 L5,0 5,1 0,1 z"
                            Fill="{Binding (TextElement.Foreground), RelativeSource={RelativeSource AncestorType=ContentPresenter}}"/>
                </Grid>
            </telerikRibbonView:RadRibbonDropDownButton>
        </Grid>
    </ControlTemplate>
    <Style x:Key="QuickAccessToolBarStyle" TargetType="telerikRibbonView:QuickAccessToolBar">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Background" Value="{StaticResource QatBelowBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource QatBelowOuterBorderBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="CustomizationMenuVisibility" Value="Visible"/>
        <Setter Property="Template" Value="{StaticResource QuickAccessToolBarTemplate}"/>
    </Style>
    <Style x:Key="WindowTitleStyle" TargetType="telerikRibbonViewPrimitives:WindowTitle">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Margin" Value="0 6"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonTitlebarApplicationNameBrush}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="IsHitTestVisible" Value="false"/>
        <Setter Property="IsActive" Value="True"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikRibbonViewPrimitives:WindowTitle">
                    <telerikRibbonViewPrimitives:WindowTitlePanel>
                        <TextBlock x:Name="Title" Text="{TemplateBinding Title}" Foreground="{TemplateBinding Foreground}" TextTrimming="CharacterEllipsis"/>
                        <TextBlock x:Name="Divider"
                                Text="{telerik:LocalizableResource Key=RibbonViewWindowTitleDivider}"
                                Visibility="{TemplateBinding DividerVisibility}"
                                Foreground="{TemplateBinding Foreground}"/>
                        <TextBlock x:Name="ApplicationName" Text="{TemplateBinding ApplicationName}" Foreground="{TemplateBinding Foreground}" TextTrimming="CharacterEllipsis"/>
                    </telerikRibbonViewPrimitives:WindowTitlePanel>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=telerikRibbonView:RadRibbonView}, Path=IsHostedInRibbonWindow}" Value="True">
                            <c:Case Condition="VisualStudio2013">
                                <Setter TargetName="WindowTitle" Property="Foreground" Value="{StaticResource MarkerBrush}"/>
                            </c:Case>
                            <c:Default>
                                <Setter TargetName="WindowTitle" Property="Foreground" Value="{StaticResource RibbonWindow_TitlebarApplicationNameBrush}"/>
                            </c:Default>
                        </DataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsHostedInRibbonWindow, RelativeSource={RelativeSource AncestorType=telerikRibbonView:RadRibbonView}, FallbackValue=False}" Value="True"/>
                                <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=telerikRibbonView:RadRibbonWindow}, Path=IsWindowsThemeEnabled}" Value="True"/>
                                <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=telerikRibbonView:RadRibbonWindow}, Path=IsTitleVisible}" Value="False"/>
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Foreground" Value="Black"/>
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HelpButtonStyle" TargetType="telerikRibbonView:RadRibbonButton" BasedOn="{StaticResource RadRibbonButtonStyle}">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
    </Style>
    <ControlTemplate x:Key="MinimizeButtonTemplate" TargetType="telerikRibbonView:RadRibbonToggleButton">
        <Grid x:Name="RootElement">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="OuterBorder">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonOverBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="OuterBorder">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonOverBorder}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="InnerBorder">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonOverBorderInner}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="OuterBorder">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonPressedBackground}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="OuterBorder">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonPressedBorder}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="InnerBorder">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RadRibbonBarButtonPressedBorderInner}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="arrow" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootElement" Storyboard.TargetProperty="(telerikRibbonView:ScreenTip.Title)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:LocalizableResource Key=RibbonViewMinimizeRibbon}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Checked">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="directionRotation" Storyboard.TargetProperty="Angle" To="0" Duration="0"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="arrow" Storyboard.TargetProperty="Margin" Duration="0">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>0 0 0 -2</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootElement" Storyboard.TargetProperty="(telerikRibbonView:ScreenTip.Title)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:LocalizableResource Key=RibbonViewExpandRibbon}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="KeyboardNavigationStates">
                    <VisualState x:Name="KeyboardUnfocused"/>
                    <VisualState x:Name="KeyboardFocused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="KeyboardNavigationVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="OuterBorder"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="2">
                <Border x:Name="InnerBorder" BorderBrush="Transparent" BorderThickness="1"/>
            </Border>
            <Border x:Name="KeyboardNavigationVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"
                    Background="{StaticResource RadRibbonBarButtonOverBackground}"
                    BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}">
                <Border CornerRadius="2" BorderThickness="1" BorderBrush="{StaticResource RadRibbonBarButtonOverBorderInner}"/>
            </Border>
            <Path x:Name="arrow"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center"
                    Data="M0,0 L3,0 6,3 9,0 12,0 6,6 z"
                    RenderTransformOrigin="0.5 0.5"
                    Stretch="None"
                    Fill="White"
                    Stroke="Black"
                    StrokeThickness="0.5"
                    Margin="0 -2 0 0"
                    Width="13"
                    Height="6">
                <Path.RenderTransform>
                    <RotateTransform x:Name="directionRotation" Angle="180"/>
                </Path.RenderTransform>
            </Path>
        </Grid>
    </ControlTemplate>
    <Style x:Key="MinimizeButtonStyle" TargetType="telerikRibbonView:RadRibbonToggleButton">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Size" Value="Small"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinWidth" Value="22"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="Margin" Value="1"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Template" Value="{StaticResource MinimizeButtonTemplate}"/>
    </Style>
    <ControlTemplate x:Key="RadRibbonViewTemplate" TargetType="telerikRibbonView:RadRibbonView">
        <Grid x:Name="RootPanel">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Rectangle Grid.Row="1" Grid.RowSpan="2" Fill="{TemplateBinding Background}"/>
            <ContentPresenter x:Name="SelectedTabContent" Grid.Row="1" Height="{TemplateBinding ContentHeight}" Margin="1 0 1 0"/>
            <Grid x:Name="TopGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border x:Name="titleBarBackground" Background="{TemplateBinding TitleBarBackground}" IsHitTestVisible="False" Grid.ColumnSpan="3"/>
                <Rectangle Grid.Row="1" Grid.ColumnSpan="3" StrokeThickness="0" Fill="{TemplateBinding Background}"/>
                <telerikRibbonViewPrimitives:RibbonTitleBarPanel x:Name="RibbonTitleBarPanel" Grid.ColumnSpan="2" Visibility="{TemplateBinding TitleBarVisibility}">
                    <ContentPresenter x:Name="AboveToolBarHost" VerticalAlignment="Center" telerikRibbonViewPrimitives:RibbonTitleBarPanel.Element="QuickAccessToolBar"/>
                    <telerikRibbonViewPrimitives:WindowTitle x:Name="WindowTitle"
                            Title="{TemplateBinding Title}"
                            telerikRibbonViewPrimitives:RibbonTitleBarPanel.Element="WindowTitle"
                            ApplicationName="{TemplateBinding ApplicationName}"
                            Style="{TemplateBinding WindowTitleStyle}"/>
                    <StackPanel x:Name="ContextualGroupsHeaders" Margin="1 0 0 0" Orientation="Horizontal" telerikRibbonViewPrimitives:RibbonTitleBarPanel.Element="ContextualGroupsPanel"/>
                </telerikRibbonViewPrimitives:RibbonTitleBarPanel>
                <telerikRibbonViewPrimitives:RadRibbonApplicationDropDownButton x:Name="ApplicationButton"
                        Grid.Row="1"
                        IsEnabled="{TemplateBinding IsApplicationButtonEnabled}"
                        IsOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsApplicationMenuOpen, Mode=TwoWay}"
                        SmallImage="{TemplateBinding ApplicationButtonImageSource}"
                        Content="{TemplateBinding ApplicationButtonContent}"
                        Visibility="{TemplateBinding ApplicationButtonVisibility}"
                        Style="{TemplateBinding ApplicationButtonStyle}"/>
                <telerikRibbonViewPrimitives:RibbonScrollViewer Grid.Column="1" Grid.Row="1" Margin="0 0 0 -1" x:Name="TabsScrollViewer">
                    <ItemsPresenter/>
                </telerikRibbonViewPrimitives:RibbonScrollViewer>
                <StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="1">
                    <telerikRibbonView:RadRibbonToggleButton x:Name="MinimizeButton"
                            Style="{TemplateBinding MinimizeButtonStyle}"
                            Visibility="{TemplateBinding MinimizeButtonVisibility}"
                            IsEnabled="{TemplateBinding IsMinimizable}"
                            IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsMinimized, Mode=TwoWay}"/>
                    <telerikRibbonView:RadRibbonButton
                            Command="{TemplateBinding HelpCommand}"
                            CommandParameter="{TemplateBinding HelpCommandParameter}"
                            CommandTarget="{TemplateBinding HelpCommandTarget}"
                            x:Name="HelpButton"
                            Visibility="{TemplateBinding HelpButtonVisibility}"
                            SmallImage="{TemplateBinding HelpButtonImageSource}"
                            Style="{TemplateBinding HelpButtonStyle}"
                            telerikRibbonView:ScreenTip.Title="{telerik:LocalizableResource Key=RibbonViewHelp}"/>
                    <ContentPresenter Content="{TemplateBinding TabStripAdditionalContent}"/>
                </StackPanel>
                <Rectangle Fill="Transparent" VerticalAlignment="Bottom" Height="2" Margin="0 0 0 -1" Grid.ColumnSpan="3" Grid.RowSpan="2"/>
            </Grid>
            <ContentPresenter x:Name="BelowToolBarHost" Grid.Row="2"/>
            <Popup x:Name="TabContentPopup" VerticalOffset="-1" PlacementTarget="{Binding ElementName=TopGrid}" AllowsTransparency="True">
                <ContentPresenter x:Name="SelectedTabContentPopup" Height="{TemplateBinding ContentHeight}"/>
            </Popup>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsHostedInRibbonWindow" Value="true">
                <Setter TargetName="titleBarBackground" Property="Visibility" Value="Collapsed"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="RadRibbonViewStyle" TargetType="telerikRibbonView:RadRibbonView">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <telerikRibbonViewPrimitives:RibbonTabStripPanel/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusManager.IsFocusScope" Value="True"/>
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="None"/>
        <Setter Property="KeyboardNavigation.ControlTabNavigation" Value="None"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="Foreground" Value="{StaticResource RibbonForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource RibbonBackgroundBrush}"/>
        <Setter Property="TitleBarBackground" Value="{StaticResource RibbonTitlebarBackgroundBrush}"/>
        <Setter Property="ContentHeight" Value="96"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="ApplicationButtonStyle" Value="{StaticResource RadRibbonApplicationDropDownButtonStyle}"/>
        <Setter Property="HelpButtonStyle" Value="{StaticResource HelpButtonStyle}"/>
        <Setter Property="MinimizeButtonStyle" Value="{StaticResource MinimizeButtonStyle}"/>
        <Setter Property="ContextualTabsStyle" Value="{StaticResource ContextualTabsStyle}"/>
        <Setter Property="WindowTitleStyle" Value="{StaticResource WindowTitleStyle}"/>
        <Setter Property="HelpButtonImageSource">
            <Setter.Value>
                <BitmapImage UriSource="pack://application:,,,/Telerik.Windows.Controls.RibbonView;component/HelpIcon.png"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" Value="{StaticResource RadRibbonViewTemplate}"/>
    </Style>
    <Style TargetType="telerikRibbonView:QuickAccessToolBar" BasedOn="{StaticResource QuickAccessToolBarStyle}"/>
    <Style TargetType="telerikRibbonViewPrimitives:WindowTitle" BasedOn="{StaticResource WindowTitleStyle}"/>
    <Style TargetType="telerikRibbonView:RadRibbonView" BasedOn="{StaticResource RadRibbonViewStyle}"/>
    <Style TargetType="telerikRibbonView:RadRibbonContextualGroup" BasedOn="{StaticResource ContextualGroupsStyle}"/>
    <Style x:Key="RadRibbonWindowCloseButtonStyle" TargetType="telerik:RadButton">
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Height" Value="22"/>
        <Setter Property="Width" Value="22"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadButton">
                    <Grid Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonWindowButtonsHoverColor}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedVisual"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="NormalVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="PressedVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Opacity="0"
                                Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                                BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"/>
                        <Border x:Name="MouseOverVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Opacity="0"
                                Background="{StaticResource RadRibbonBarButtonOverBackground}"
                                BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Path
                                    Fill="{StaticResource RibbonWindow_Path_Background}"
                                    Margin="1 0 0 0"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Data="M1,0L5,4L9,0L10,1L6,5L10,9L9,10L5,6L1,10L0,9L4,5L0,1z"/>
                            <Path x:Name="Path" Fill="#FFE0E1E2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="-1 0 0 0" Data="M1,0L5,4L9,0L10,1L6,5L10,9L9,10L5,6L1,10L0,9L4,5L0,1z"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadRibbonWindowMinimizeButtonStyle" TargetType="telerik:RadButton">
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Height" Value="22"/>
        <Setter Property="Width" Value="22"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadButton">
                    <Grid Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonWindowButtonsHoverColor}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedVisual"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Path" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonWindowButtonsPressedColor}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="NormalVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="PressedVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Opacity="0"
                                Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                                BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"/>
                        <Border x:Name="MouseOverVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Opacity="0"
                                Background="{StaticResource RadRibbonBarButtonOverBackground}"
                                BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Path x:Name="Path"
                                    Margin="0 4 0 0"
                                    Data="M0,0 L12,0 12,5 0,5 z M1,1 L11,1 11,4 1,4 z"
                                    Fill="{StaticResource RibbonWindow_Path_InnerBorder}"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"/>
                            <Path Margin="0 4 0 0" Data="M0,0 L10,0 10,3 0,3 z" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource RibbonWindow_Path_Background}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadRibbonWindowToggleButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Height" Value="22"/>
        <Setter Property="Width" Value="22"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadToggleButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MaximizedPath" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonWindowButtonsHoverColor}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RestoredPath" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonWindowButtonsHoverColor}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedVisual"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MaximizedPath" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonWindowButtonsPressedColor}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RestoredPath" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RibbonWindowButtonsPressedColor}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard Duration="0">
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="NormalVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="PressedVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Opacity="0"
                                Background="{StaticResource RadRibbonBarButtonPressedBackground}"
                                BorderBrush="{StaticResource RadRibbonBarButtonPressedBorder}"/>
                        <Border x:Name="MouseOverVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Opacity="0"
                                Background="{StaticResource RadRibbonBarButtonOverBackground}"
                                BorderBrush="{StaticResource RadRibbonBarButtonOverBorder}"/>
                        <Grid x:Name="Restore" Background="Transparent" ToolTipService.ToolTip="Maximize">
                            <Grid.ToolTip>
                                <TextBlock Text="{telerik:LocalizableResource Key=RibbonWindowMaximize}"/>
                            </Grid.ToolTip>
                            <Path x:Name="MaximizedPath" Data="M0,0 L12,0 12,10 0,10 z" Fill="{StaticResource RibbonWindow_Path_InnerBorder}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Path Data="M0,0 L10,0 10,8 0,8 z" HorizontalAlignment="Center" Fill="{StaticResource RibbonWindow_Path_Background}" VerticalAlignment="Center"/>
                        </Grid>
                        <Grid Visibility="Collapsed" x:Name="Collapse" Background="Transparent" ToolTipService.ToolTip="Restore Down" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Grid.ToolTip>
                                <TextBlock Text="{telerik:LocalizableResource Key=RibbonWindowRestoreDown}"/>
                            </Grid.ToolTip>
                            <Path x:Name="RestoredPath"
                                    Data="M0,3 L3,3 3,0 14,0 14,10 11,10 11,13 0,13 z"
                                    Fill="{StaticResource RibbonWindow_Path_InnerBorder}"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Top"/>
                            <Path
                                    Data="M1,4 L10,4 10,12 1,12 z M4,1 L13,1 13,9 11,9 11,3 4,3 z"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Top"
                                    Fill="{StaticResource RibbonWindow_Path_Background}"/>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="Restore" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="Collapse" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonWindow" x:Key="RadRibbonWindowStyle">
        <Setter Property="TitleBarStyle" Value="{StaticResource WindowTitleStyle}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="WindowBackground" Value="{StaticResource RibbonWindow_Background}"/>
        <Setter Property="Background" Value="{StaticResource RibbonWindow_ContentBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource RibbonWindow_OuterBorder}"/>
        <Setter Property="shell:WindowChrome.WindowChromeCornerRadius" Value="9"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikRibbonView:RadRibbonWindow">
                    <Grid Background="Transparent">
                        <Border x:Name="outerBorder"
                                Background="{TemplateBinding WindowBackground}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="5">
                            <Grid x:Name="MaximizeWindowDecorator">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="28"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="1" Background="{TemplateBinding WindowBackground}" BorderThickness="{TemplateBinding BorderThickness}"/>
                                <Grid Grid.ColumnSpan="3">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel x:Name="IconPanel" Orientation="Horizontal" HorizontalAlignment="Left" Visibility="{TemplateBinding IconVisibility}" VerticalAlignment="Center" Margin="7 0 0 0">
                                        <Image
                                                Name="PART_Icon"
                                                shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                                Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Icon, Converter={StaticResource IconConverter}}"
                                                Width="{Binding Path=SmallIconSize.Width, Source={x:Static shell:SystemParameters2.Current}}"
                                                Height="{Binding Path=SmallIconSize.Height, Source={x:Static shell:SystemParameters2.Current}}"/>
                                        <Rectangle Width="1" Margin="4 0" Fill="{StaticResource RibbonWindow_Separator_Background}"/>
                                    </StackPanel>
                                    <telerikRibbonViewPrimitives:WindowTitle x:Name="WindowTitle"
                                            Grid.Column="1"
                                            Title="{TemplateBinding Title}"
                                            Style="{TemplateBinding TitleBarStyle}"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Center"
                                            Margin="0 0 65 0"/>
                                </Grid>
                                <StackPanel x:Name="buttonPanel" Orientation="Horizontal" Grid.ColumnSpan="3" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 7 0">
                                    <telerik:RadButton x:Name="minimizeButton"
                                            shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                            ToolTipService.ToolTip="Minimize"
                                            Command="{x:Static shell:SystemCommands.MinimizeWindowCommand}"
                                            Style="{StaticResource RadRibbonWindowMinimizeButtonStyle}">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock Text="{telerik:LocalizableResource Key=RibbonWindowMinimize}"/>
                                        </telerik:RadButton.ToolTip>
                                    </telerik:RadButton>
                                    <telerik:RadToggleButton x:Name="maximizeButton"
                                            shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                            IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=WindowState, Converter={StaticResource BooleanToWindowStateConverter}, Mode=TwoWay}"
                                            Style="{StaticResource RadRibbonWindowToggleButtonStyle}"/>
                                    <telerik:RadButton x:Name="closeButton"
                                            shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                            Command="{x:Static shell:SystemCommands.CloseWindowCommand}"
                                            Style="{StaticResource RadRibbonWindowCloseButtonStyle}">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock Text="{telerik:LocalizableResource Key=RibbonWindowClose}"/>
                                        </telerik:RadButton.ToolTip>
                                    </telerik:RadButton>
                                </StackPanel>
                                <Border x:Name="leftBorder" Grid.Row="1" Width="7" Margin="0 20 0 20"/>
                                <Border x:Name="rightBorder" Grid.Row="1" Grid.Column="2" Width="7" Margin="0 20 0 20"/>
                                <Border Grid.Row="2" x:Name="bottomBorder" Grid.ColumnSpan="3" Height="7" VerticalAlignment="Bottom"/>
                                <Border x:Name="PART_ClientAreaBorder"
                                        Background="{TemplateBinding Background}"
                                        Grid.Column="1"
                                        Grid.Row="1"
                                        BorderBrush="{StaticResource RibbonWindow_OuterBorder}"
                                        BorderThickness="1"/>
                                <AdornerDecorator x:Name="Adorner" Grid.Column="1" Grid.RowSpan="2" Margin="1">
                                    <ContentPresenter Canvas.ZIndex="0" Name="PART_RootContentPresenter"/>
                                </AdornerDecorator>
                                <ResizeGrip x:Name="WindowResizeGrip"
                                        Grid.Row="1"
                                        Grid.Column="1"
                                        shell:WindowChrome.ResizeGripDirection="BottomRight"
                                        HorizontalAlignment="Right"
                                        VerticalAlignment="Bottom"
                                        Visibility="Collapsed"
                                        IsTabStop="false"/>
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Window.ResizeMode" Value="CanResizeWithGrip"/>
                                <Condition Property="Window.WindowState" Value="Normal"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="WindowResizeGrip" Property="Visibility" Value="Visible"/>
                        </MultiTrigger>
                        <Trigger Property="Window.ResizeMode" Value="NoResize">
                            <Setter TargetName="minimizeButton" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="maximizeButton" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="closeButton" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="WindowState" Value="Maximized">
                            <Setter TargetName="MaximizeWindowDecorator" Property="Margin" Value="1 4 1 1"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="telerik:RadRibbonWindow.IsAutoHideTaskbar" Value="True"/>
                                <Condition Property="Window.WindowState" Value="Maximized"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="MaximizeWindowDecorator" Property="Margin" Value="-8 -4 -8 -8"/>
                        </MultiTrigger>
                        <Trigger Property="IsTitleVisible" Value="False">
                            <Setter TargetName="WindowTitle" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikRibbonView:RadRibbonWindow" BasedOn="{StaticResource RadRibbonWindowStyle}"/>
</ResourceDictionary>
