<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:c="http://schemas.telerik.com/2008/xaml/compile"
        mc:Ignorable="c"
        xmlns:spreadsheetControls="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Controls;assembly=Telerik.Windows.Controls.Spreadsheet"
        xmlns:telerikDragDrop="clr-namespace:Telerik.Windows.DragDrop;assembly=Telerik.Windows.Controls"
        xmlns:worksheetMargins="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Worksheets.Margins;assembly=Telerik.Windows.Controls.Spreadsheet"
        xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Spreadsheet"
        xmlns:worksheet="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Worksheets;assembly=Telerik.Windows.Controls.Spreadsheet"
        xmlns:spreadsheetUtilities="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Utilities;assembly=Telerik.Windows.Controls.Spreadsheet"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:worksheetCommands="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Worksheets.Commands;assembly=Telerik.Windows.Controls.Spreadsheet"
        xmlns:dialogs="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Dialogs;assembly=Telerik.Windows.Controls.Spreadsheet"
        xmlns:grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView">
    <telerik:IconSources x:Key="IconPaths" LightBasePath="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/" DarkBasePath="/Telerik.Windows.Controls.Spreadsheet;component/Images/Dark/"/>
    <SolidColorBrush x:Key="ControlElement_Normal" Color="#FF3C6AA3"/>
    <SolidColorBrush x:Key="ControlOuterBorder" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="FilteringPopupMenuIconsBackground" Color="#FFE2F0FD"/>
    <SolidColorBrush x:Key="FilteringPopupMenuIconsSeparatorLeft" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="FilteringPopupMenuTreeViewBrush" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="HyperlinkButtonMouseOverBrush" Color="#FFFD9F2F"/>
    <SolidColorBrush x:Key="HyperlinkButtonForegroundBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="NameBoxBorderBrush" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="NameBoxPathFillBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="PrintPreviewSeparatorBrush" Color="#FFE1E1E1"/>
    <SolidColorBrush x:Key="DialogsBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="RadSpreadsheetBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="LineStyleStrokeBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="BordersPreviewBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="BordersPreviewForegroundBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="StyleGallery_ArrowButtonBrush" Color="#FF567DB1"/>
    <SolidColorBrush x:Key="StyleGallery_ArrowButtonHighlight" Color="#FFEFF6FC"/>
    <SolidColorBrush x:Key="SeparatorLightBrush" Color="#FFD5DFE5"/>
    <SolidColorBrush x:Key="LineToTextSeparatorBrush" Color="#FF848484"/>
    <SolidColorBrush x:Key="RowColHeadingForegroundBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="NormalFillBrush" Color="#FFE2F0FD"/>
    <SolidColorBrush x:Key="SelectedFillBrush" Color="#FFAAAAAA"/>
    <SolidColorBrush x:Key="SelectedRowFillBrush" Color="#FFFFDC61"/>
    <SolidColorBrush x:Key="HoverRowFillBrush" Color="#FFFFEB91"/>
    <SolidColorBrush x:Key="HoverFillBrush" Color="#FF919191"/>
    <SolidColorBrush x:Key="FullySelectedFillBrush" Color="#FFAAAAAA"/>
    <SolidColorBrush x:Key="RectangleStrokeBrush" Color="#FFB1B5BA"/>
    <LinearGradientBrush x:Key="HoverFillGradientBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFFFE167" Offset="0"/>
        <GradientStop Color="#FFFFF89F" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="SelectedFillGradientBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFFFD45A" Offset="0"/>
        <GradientStop Color="#FFFFED70" Offset="1"/>
    </LinearGradientBrush>
    <Thickness x:Key="HorizontalScrollBarMarginThickness">-1 0 0 -1</Thickness>
    <Thickness x:Key="StatusBarMarginThickness">-1 0 -1 -1</Thickness>
    <SolidColorBrush x:Key="GridSplitterBackgroundBrush" Color="#FFE2F0FD"/>
    <SolidColorBrush x:Key="GridSplitterForegroundBrush" Color="#FF848484"/>
    <LinearGradientBrush x:Key="SpreadsheetToolTipBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FBFCFD"/>
        <GradientStop Offset="1" Color="#D0DEF1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="SpreadsheetToolTipBorderBrush" Color="#FF767676"/>
    <SolidColorBrush x:Key="SpreadsheetToolTipForegroundBrush" Color="#FF4C4C4C"/>
    <SolidColorBrush x:Key="SheetSelectorNavigationButtonBrush" Color="#FF4C535C"/>
    <SolidColorBrush x:Key="SheetSelectorOuterBackgroundBrush" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="SheetSelectorInnerBorderBrush" Color="#FFF5F6F7"/>
    <SolidColorBrush x:Key="SheetSelectorInnerBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="SheetSelectorDarkLineBrush" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="SheetSelectorLightLineBrush" Color="#FFF5F6F7"/>
    <SolidColorBrush x:Key="SheetSelectorMainBackgroundBrush" Color="#FFE2F0FD"/>
    <Color x:Key="ThemeControlDropShadowEffectColor">#FF455F7E</Color>
    <SolidColorBrush x:Key="ThemeControlLightBrush" Color="#FFDADADA"/>
    <SolidColorBrush x:Key="ThemeControlLowBrush" Color="#FF9FADBF"/>
    <SolidColorBrush x:Key="ThemeControlMediumBrush" Color="#FF616C81"/>
    <SolidColorBrush x:Key="ThemeControlHighBrush" Color="#FF344C64"/>
    <SolidColorBrush x:Key="ThemeControlMainBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="ThemeControlPathFillBrush" Color="#FFE4EBF5"/>
    <SolidColorBrush x:Key="ThemeControlRectangleStrokeBrush" Color="#FF868686"/>
    <SolidColorBrush x:Key="ThemeControlFontPreviewLightBrush" Color="#FFF5F5F5"/>
    <SolidColorBrush x:Key="ThemeControlFontPreviewDarkBrush" Color="#FFC3C8D5"/>
    <SolidColorBrush x:Key="ThemeControlFontSmallPreviewRectangleBorderBrush" Color="#FF83A5D2"/>
    <LinearGradientBrush x:Key="ThemeControlFontSmallPreviewRectangleGradientBrush" StartPoint="0.5 0" EndPoint="0.5 1">
        <GradientStop Color="#FFF4FAFF" Offset="0"/>
        <GradientStop Color="#FFD6EAFF" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ControlBackground_Highlighted" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFFFFBDA" Offset="0"/>
        <GradientStop Color="#FFFFFBA3" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#FFFFC92B"/>
    <SolidColorBrush x:Key="ControlSubItem_OuterBorder_Selected" Color="#FFFFC92B"/>
    <LinearGradientBrush x:Key="ControlSubItem_Background_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFFCE79F" Offset="1"/>
        <GradientStop Color="#FFFDD3A8"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="StyleGalleryHeaderItemBackgroundBrush" Color="#FFE8EBF4"/>
    <SolidColorBrush x:Key="StyleGalleryHeaderItemForegroundBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="StyleGalleryItemBorderBrush" Color="#FFC28F36"/>
    <SolidColorBrush x:Key="StyleGallerySelectedItemBackgroundBrush" Color="#FFFFD86C"/>
    <SolidColorBrush x:Key="StyleGalleryMouseOverItemBackgroundBrush" Color="#FFFDE58D"/>
    <SolidColorBrush x:Key="FormulaBoxBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="FormulaBoxForegroundBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="FormulaBoxBorderBrush" Color="#FF9CA2A7"/>
    <SolidColorBrush x:Key="ControlForeground_Normal" Color="#FF000000"/>
    <SolidColorBrush x:Key="FormulaBarBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="FormulaBarBorderBrush" Color="#FF9CA2A7"/>
    <SolidColorBrush x:Key="FormulaBarFunctionInputOperatorBrush" Color="#FFE2F0FD"/>
    <LinearGradientBrush x:Key="FormulaBarEllipseBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFEFF2F3" Offset="1"/>
        <GradientStop Color="#FFADB1B6"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ZoomInOutButtonForegroundBrush" Color="#FF828588"/>
    <SolidColorBrush x:Key="ZoomInOutButtonBorderBrush" Color="#FF64676A"/>
    <LinearGradientBrush x:Key="ZoomInOutButtonBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFF4F4F5" Offset="0.723"/>
        <GradientStop Color="#FFE3E6E9" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="SliderDarkerBrush" Color="#FF64676A"/>
    <SolidColorBrush x:Key="SliderLighterBrush" Color="#FFF4F4F5"/>
    <SolidColorBrush x:Key="TransparentBrush" Color="Transparent"/>
    <SolidColorBrush x:Key="WorksheetScrollViewersPane_Brush" Color="#FFE2F0FD"/>
    <LinearGradientBrush x:Key="RadSpreadsheetStatusBar_Background" EndPoint="0.5 1" StartPoint="0.5 0">
        <GradientStop Color="#FFBCD1E4" Offset="0"/>
        <GradientStop Color="#FFE2F0FD" Offset="0.3"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="RadSpreadsheetStatusBar_BorderBrush" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="SortingDialogHeaderItemBackground" Color="#FFFCFCFC"/>
    <SolidColorBrush x:Key="SortingDialogHeaderItemSeparatorBorderBrush" Color="#FFE8F1FB"/>
    <SolidColorBrush x:Key="ColorPicker_Background" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="ColorPicker_OuterBorder" Color="#FF848484"/>
    <SolidColorBrush x:Key="ColorPicker_Foreground" Color="#FF000000"/>
    <SolidColorBrush x:Key="ColorPaletteViewItem_Border" Color="#FFC9C9CB"/>
    <SolidColorBrush x:Key="ColorPaletteViewItem_OuterBorder_MouseOver" Color="#FFFFC92B"/>
    <SolidColorBrush x:Key="ColorPaletteViewItem_InnerBorder_MouseOver" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="ColorPaletteViewItem_OuterBorder_Selected" Color="#FF5D5D5D"/>
    <LinearGradientBrush x:Key="ColorPaletteViewItem_InnerBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFB69A78"/>
        <GradientStop Color="#FFFFE17A" Offset="0.126"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ColorPicker_InnerBorder" Color="#FFF5F5F5"/>
    <SolidColorBrush x:Key="ColorPicker_TitleBorder" Color="#FF848484"/>
    <SolidColorBrush x:Key="ColorPicker_TitleBackground" Color="#FFDEDEDE"/>
    <SolidColorBrush x:Key="BorderLineOuterColor" Color="#26000000"/>
    <SolidColorBrush x:Key="BorderLineInnerColor" Color="#FFFFFFFF"/>
    <telerik:ColorToBrushConverter x:Key="converter"/>
    <telerik:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
    <telerik:BooleanToVisibilityConverter x:Key="SpreadsheetBooleanToVisibilityConverter"/>
    <spreadsheetControls:PageOrientationToBooleanConverter x:Key="PageOrientationToBooleanConverter"/>
    <spreadsheetControls:ScalingMethodToBooleanConverter x:Key="ScalingMethodToBooleanConverter"/>
    <spreadsheetControls:PageOrderToBooleanConverter x:Key="PageOrderToBooleanConverter"/>
    <spreadsheetControls:PatternTypeToIntConverter x:Key="PatternTypeToIntConverter"/>
    <spreadsheetControls:ColorToThemableColorConverter x:Key="ColorToThemableColorConverter"/>
    <spreadsheetControls:ShadingStyleToBooleanConverter x:Key="ShadingStyleToBooleanConverter"/>
    <spreadsheetControls:FillTabStateToVisibilityConverter x:Key="FillTabStateToVisibilityConverter"/>
    <spreadsheetControls:RadHorizontalAlignmentToStringConverter x:Key="RadHorizontalAlignmentToStringConverter"/>
    <spreadsheetControls:RadVerticalAlignmentToStringConverter x:Key="RadVerticalAlignmentToStringConverter"/>
    <spreadsheetControls:FormatStringCategoryToStringConverter x:Key="FormatStringCategoryToStringConverter"/>
    <spreadsheetControls:ThemeFontTypeToTextConverter x:Key="themeFontTypeToTextConverter"/>
    <spreadsheetControls:UnderlineTypesToStringConverter x:Key="UnderlineTypesToStringConverter"/>
    <spreadsheetControls:SeriesTypeToBooleanConverter x:Key="SeriesTypeToBooleanConverter"/>
    <spreadsheetControls:SeriesOrientationToBooleanConverter x:Key="SeriesOrientationToBooleanConverter"/>
    <spreadsheetControls:SeriesDateUnitToBooleanConverter x:Key="SeriesDateUnitToBooleanConverter"/>
    <spreadsheetControls:BooleanToInversedBooleanConverter x:Key="BooleanToInversedBooleanConverter"/>
    <spreadsheetControls:CellIndexToNameConverter x:Key="CellIndexToNameConverter"/>
    <spreadsheetControls:IntToColumnNameConverter x:Key="IntToColumnNameConverter"/>
    <spreadsheetControls:SortTypeToStringConverter x:Key="SortTypeToStringConverter"/>
    <spreadsheetControls:DoubleToPercentConverter x:Key="doubleToPercentConverter"/>
    <spreadsheetControls:CellValueFormatToNumberFormatInfoConverter x:Key="cellValueFormatToNumberFormatInfoConverter"/>
    <spreadsheetControls:BoolToVisibilityValueConverter x:Key="BoolToVisibilityValueConverter"/>
    <spreadsheetControls:InversedBoolToVisibilityValueConverter x:Key="InversedBoolToVisibilityValueConverter"/>
    <spreadsheetControls:BoolToIntegerConverter x:Key="BoolToIntegerConverter"/>
    <telerik:BooleanToOpacityConverter x:Key="BooleanToOpacityConverter"/>
    <telerik:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
    <spreadsheetControls:PatternFillToBackgroundColorConverter x:Key="PatternFillToBackgroundColorConverter"/>
    <spreadsheetControls:PatternFillToPatternColorConverter x:Key="PatternFillToPatternColorConverter"/>
    <spreadsheetControls:LogicalOperatorToBooleanConverter x:Key="LogicalOperatorToBooleanConverter"/>
    <spreadsheetControls:TopBottomFilterTypeToStringConverter x:Key="TopBottomFilterTypeToStringConverter"/>
    <spreadsheetControls:ItemsPercentFilterTypeToStringConverter x:Key="ItemsPercentFilterTypeToStringConverter"/>
    <spreadsheetControls:ComparisonOperatorItemToStringConverter x:Key="ComparisonOperatorItemToStringConverter"/>
    <spreadsheetControls:FilterToVisibilityConverter x:Key="FilterToVisibilityConverter"/>
    <spreadsheetControls:NameScopeToStringConverter x:Key="NameScopeToStringConverter"/>
    <Style x:Key="LinkButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HyperlinkButtonForegroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="decorator">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="presenter">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Cursor)" Storyboard.TargetName="decorator">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Cursor>Hand</Cursor>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <TextBlock x:Name="presenter" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}"/>
                        <TextBlock x:Name="decorator" Foreground="{StaticResource HyperlinkButtonMouseOverBrush}" TextDecorations="Underline" Visibility="Collapsed" Text="{TemplateBinding Content}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadColorPaletteViewItemStylePredefined" TargetType="telerik:RadColorPaletteViewItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadColorPaletteViewItem">
                    <Grid x:Name="RootElement" Margin="0">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="border">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Innerborder">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ColorPaletteViewItem_InnerBorder_Selected}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="border">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ColorPaletteViewItem_OuterBorder_Selected}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="border">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="PositionStates">
                                <VisualState x:Name="Top">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1 1 1 0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Single">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Middle">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1 0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="13"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Bottom">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1 0 1 1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="color" Fill="{TemplateBinding Content}" Stretch="Fill" ToolTipService.ToolTip="{Binding}" MinWidth="11" MinHeight="11" Margin="2 0"/>
                        <Border x:Name="borderContent"
                                BorderBrush="{StaticResource ColorPaletteViewItem_Border}"
                                BorderThickness="0"
                                Margin="2 0"
                                MinWidth="13"
                                MinHeight="13"
                                VerticalAlignment="Stretch">
                            <Border x:Name="InnerborderContent" BorderThickness="1"/>
                        </Border>
                        <Border x:Name="border"
                                BorderBrush="{StaticResource ColorPaletteViewItem_OuterBorder_MouseOver}"
                                BorderThickness="1"
                                Visibility="Collapsed"
                                VerticalAlignment="Stretch"
                                MinWidth="13"
                                MinHeight="13"
                                Margin="2 0">
                            <Border x:Name="Innerborder" BorderBrush="{StaticResource ColorPaletteViewItem_InnerBorder_MouseOver}" BorderThickness="1"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Content" Value="Color"/>
        <Setter Property="Color" Value="Green"/>
    </Style>
    <Style x:Key="DefaultStylePredefined" BasedOn="{StaticResource RadColorPaletteViewItemStylePredefined}" TargetType="telerik:RadColorPaletteViewItem">
        <Setter Property="Color" Value="Black"/>
    </Style>
    <Style x:Key="RadColorSelectorStylePredefined" TargetType="telerik:RadColorSelector">
        <Setter Property="Background" Value="{StaticResource ColorPicker_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ColorPicker_OuterBorder}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Width" Value="174"/>
        <Setter Property="Foreground" Value="{StaticResource ColorPicker_Foreground}"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadColorSelector">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource ColorPicker_InnerBorder}" CornerRadius="1">
                        <Grid x:Name="RootElement" Background="{TemplateBinding Background}" Margin="0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Button x:Name="PaletteHeader"
                                    Content="{TemplateBinding NoColorText}"
                                    Tag="{Binding AutomaticColor, Converter={StaticResource converter}, RelativeSource={RelativeSource TemplatedParent}}"
                                    Width="0"
                                    Height="0"
                                    Visibility="Collapsed"/>
                            <telerik:RadColorPaletteView x:Name="HeaderPalette"
                                    BorderBrush="Transparent"
                                    BorderThickness="0"
                                    Background="{TemplateBinding Background}"
                                    Margin="0 0 0 -3"
                                    Grid.Row="2"
                                    VerticalAlignment="Center">
                                <telerik:RadColorPaletteView.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <telerik:RadUniformGrid Background="Transparent" Columns="10"/>
                                    </ItemsPanelTemplate>
                                </telerik:RadColorPaletteView.ItemsPanel>
                            </telerik:RadColorPaletteView>
                            <telerik:RadColorPaletteView x:Name="MainPalette"
                                    BorderBrush="Transparent"
                                    BorderThickness="0"
                                    Background="{TemplateBinding Background}"
                                    ItemContainerStyle="{TemplateBinding MainPaletteItemsStyle}"
                                    Margin="0 5 0 2"
                                    Grid.Row="3"/>
                            <Border x:Name="StandardPaletteBorder"
                                    Margin="0 2 0 3"
                                    Grid.Row="4"
                                    Background="{StaticResource ColorPicker_TitleBackground}"
                                    BorderBrush="{StaticResource ColorPicker_TitleBorder}"
                                    BorderThickness="0"
                                    Height="0"/>
                            <telerik:RadColorPaletteView x:Name="StandartPalette"
                                    BorderBrush="Transparent"
                                    BorderThickness="0"
                                    Background="{TemplateBinding Background}"
                                    Margin="0 0 0 1"
                                    Grid.Row="5"
                                    VerticalAlignment="Center">
                                <telerik:RadColorPaletteView.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <telerik:RadUniformGrid Background="Transparent" Columns="10"/>
                                    </ItemsPanelTemplate>
                                </telerik:RadColorPaletteView.ItemsPanel>
                            </telerik:RadColorPaletteView>
                            <Border
                                    Margin="0 2 0 3"
                                    x:Name="RecentColorsPaletteBorder"
                                    Grid.Row="6"
                                    Visibility="Collapsed"
                                    BorderThickness="0 0 0 1"
                                    Background="{StaticResource ColorPicker_TitleBackground}"
                                    BorderBrush="{StaticResource ColorPicker_TitleBorder}">
                                <TextBlock
                                        Margin="10 2 2 2"
                                        x:Name="RecentColorsPaletteHeader"
                                        FontWeight="{TemplateBinding FontWeight}"
                                        Foreground="{TemplateBinding Foreground}"
                                        Text="{TemplateBinding RecentColorsHeaderText}"/>
                            </Border>
                            <telerik:RadColorPaletteView
                                    Grid.Row="7"
                                    x:Name="RecentColorsPalette"
                                    Margin="0 0 0 1"
                                    BorderThickness="0"
                                    Background="Transparent"
                                    BorderBrush="Transparent"
                                    Visibility="Collapsed"
                                    ColorPropertyPath="{TemplateBinding ColorPropertyPath}"
                                    VerticalAlignment="Center"
                                    MinHeight="14">
                                <telerik:RadColorPaletteView.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <telerik:RadUniformGrid Background="Transparent" Columns="10" Rows="1"/>
                                    </ItemsPanelTemplate>
                                </telerik:RadColorPaletteView.ItemsPanel>
                            </telerik:RadColorPaletteView>
                            <Border Margin="0 1 0 0" Visibility="Collapsed" x:Name="AdditionalContentBorder" Grid.Row="8" BorderBrush="Transparent" BorderThickness="0">
                                <ContentPresenter Margin="0 1 0 0" Content="{TemplateBinding AdditionalContent}"/>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ColorSelectorDropDownStyle" TargetType="spreadsheetControls:ColorSelectorDropDown">
        <Setter Property="BorderBrush" Value="Black"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Height" Value="23"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:ColorSelectorDropDown">
                    <telerik:RadDropDownButton x:Name="ColorButton" IsTabStop="False" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}">
                        <telerik:RadDropDownButton.Content>
                            <Grid x:Name="ContentContainer">
                                <Border x:Name="ColorRectangleBorder" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Margin="{TemplateBinding Padding}">
                                    <Rectangle x:Name="ColorRectangle" Stretch="Fill" Width="500" Height="500">
                                        <Rectangle.Fill>
                                            <SolidColorBrush Color="{Binding ElementName=ColorSelector, Path=SelectedColor}"/>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Border>
                            </Grid>
                        </telerik:RadDropDownButton.Content>
                        <telerik:RadDropDownButton.DropDownContent>
                            <StackPanel>
                                <telerik:RadColorSelector x:Name="ColorSelector"
                                        AutomaticColor="{Binding Path=AutomaticColor, RelativeSource={RelativeSource TemplatedParent}}"
                                        SelectedColor="Black"
                                        IsTabStop="False"
                                        HeaderPaletteItemsSource="{Binding Path=HeaderPaletteItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
                                        MainPaletteItemsSource="{Binding Path=MainPaletteItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
                                        MainPaletteOrientation="{Binding Path=MainPaletteOrientation, RelativeSource={RelativeSource TemplatedParent}}"
                                        BorderThickness="0"/>
                                <telerik:RadButton x:Name="MoreColorsButton"
                                        HorizontalContentAlignment="Left"
                                        BorderThickness="0 1 0 0"
                                        Background="{Binding Background,ElementName=ColorSelector}"
                                        Grid.Row="6"
                                        IsTabStop="False">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/16/color.png" Width="16" Height="16"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_ColorSelector_MoreColors" Margin="10 0 0 0" Foreground="Black" FontWeight="Normal"/>
                                    </StackPanel>
                                </telerik:RadButton>
                            </StackPanel>
                        </telerik:RadDropDownButton.DropDownContent>
                    </telerik:RadDropDownButton>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadHexagonColorPickerStyle" TargetType="spreadsheetControls:RadHexagonColorPicker">
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:RadHexagonColorPicker">
                    <Canvas x:Name="PART_FullColorCanvas" Width="220" Height="253" Background="{StaticResource TransparentBrush}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HexagonItemStyle" TargetType="spreadsheetControls:HexagonItem">
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:HexagonItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1">
                                        <VisualTransition.GeneratedEasingFunction>
                                            <CircleEase EasingMode="EaseOut"/>
                                        </VisualTransition.GeneratedEasingFunction>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="PART_Polygon">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.35"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="PART_Polygon">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.35"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Initial"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="PART_Polygon">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.4"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="PART_Polygon">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.4"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Polygon x:Name="PART_Polygon" RenderTransformOrigin="0.92, 0.92">
                            <Polygon.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform/>
                                    <SkewTransform/>
                                    <RotateTransform/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Polygon.RenderTransform>
                        </Polygon>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="telerikDragDrop:DragDropManager.AllowDrag" Value="True"/>
        <Setter Property="AllowDrop" Value="True"/>
    </Style>
    <Style TargetType="spreadsheetControls:ColorSelectorDropDown" BasedOn="{StaticResource ColorSelectorDropDownStyle}"/>
    <Style TargetType="spreadsheetControls:RadHexagonColorPicker" BasedOn="{StaticResource RadHexagonColorPickerStyle}"/>
    <Style TargetType="spreadsheetControls:HexagonItem" BasedOn="{StaticResource HexagonItemStyle}"/>
    <Style x:Key="GalleryHeaderItemBaseStyle" TargetType="ContentControl">
        <Setter Property="Padding" Value="10 2"/>
        <Setter Property="Height" Value="20"/>
        <Setter Property="Width" Value="{Binding PopupContentWidth}"/>
        <Setter Property="Background" Value="{StaticResource StyleGalleryHeaderItemBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource StyleGalleryHeaderItemForegroundBrush}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="StyleGalleryHeaderItemStyle" TargetType="ListBoxItem" BasedOn="{StaticResource GalleryHeaderItemBaseStyle}"/>
    <Style x:Key="GalleryHeaderItemStyle" TargetType="telerik:RadListBoxItem" BasedOn="{StaticResource GalleryHeaderItemBaseStyle}"/>
    <Style x:Key="PatternFillControlStyle" TargetType="spreadsheetControls:PatternFillControl">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:PatternFillControl">
                    <Canvas x:Name="Container" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="GradientFillControlStyle" TargetType="spreadsheetControls:GradientFillControl">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:GradientFillControl">
                    <Canvas x:Name="Container" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SpreadsheetGridSplitterStyle" TargetType="spreadsheetControls:SpreadsheetGridSplitter">
        <Setter Property="Background" Value="{StaticResource GridSplitterBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource GridSplitterForegroundBrush}"/>
        <Setter Property="Padding" Value="0 3 2 3"/>
        <Setter Property="BorderThickness" Value="1 0 0 0"/>
        <Setter Property="BorderBrush" Value="{StaticResource SheetSelectorDarkLineBrush}"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:SpreadsheetGridSplitter">
                    <Grid>
                        <worksheetMargins:ResizeThumb x:Name="Thumb"
                                Width="{TemplateBinding Width}"
                                Height="{TemplateBinding Height}"
                                Foreground="{TemplateBinding Foreground}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <worksheetMargins:ResizeThumb.Template>
                                <ControlTemplate TargetType="worksheetMargins:ResizeThumb">
                                    <Grid>
                                        <Thumb x:Name="PART_Thumb"
                                                Foreground="{TemplateBinding Foreground}"
                                                Background="{TemplateBinding Background}"
                                                BorderBrush="{TemplateBinding BorderBrush}"
                                                BorderThickness="{TemplateBinding BorderThickness}">
                                            <Thumb.Template>
                                                <ControlTemplate>
                                                    <Border
                                                            Background="{Binding Background,RelativeSource={RelativeSource TemplatedParent}}"
                                                            BorderBrush="{Binding BorderBrush,RelativeSource={RelativeSource TemplatedParent}}"
                                                            BorderThickness="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent}}"
                                                            Height="{Binding Height,RelativeSource={RelativeSource TemplatedParent}}"
                                                            Width="{Binding Width,RelativeSource={RelativeSource TemplatedParent}}">
                                                        <Grid Margin="2">
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition/>
                                                                <ColumnDefinition/>
                                                            </Grid.ColumnDefinitions>
                                                            <Rectangle
                                                                    Width="1"
                                                                    Height="{Binding Height,RelativeSource={RelativeSource TemplatedParent}}"
                                                                    VerticalAlignment="Stretch"
                                                                    HorizontalAlignment="{Binding HorizontalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}"
                                                                    Fill="{Binding Foreground,RelativeSource={RelativeSource TemplatedParent}}"/>
                                                            <Rectangle
                                                                    Width="1"
                                                                    Grid.Column="1"
                                                                    Height="{Binding Height,RelativeSource={RelativeSource TemplatedParent}}"
                                                                    VerticalAlignment="Stretch"
                                                                    HorizontalAlignment="{Binding HorizontalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}"
                                                                    Fill="{Binding Foreground,RelativeSource={RelativeSource TemplatedParent}}"/>
                                                        </Grid>
                                                    </Border>
                                                </ControlTemplate>
                                            </Thumb.Template>
                                        </Thumb>
                                    </Grid>
                                </ControlTemplate>
                            </worksheetMargins:ResizeThumb.Template>
                        </worksheetMargins:ResizeThumb>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadSpreadsheetStyle" TargetType="telerikControls:RadSpreadsheet">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Background" Value="{StaticResource RadSpreadsheetBackgroundBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikControls:RadSpreadsheet">
                    <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <ContentControl x:Name="PART_PrintContentContainer"
                                    Opacity="0"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    HorizontalContentAlignment="Stretch"
                                    VerticalContentAlignment="Stretch"
                                    IsTabStop="False"
                                    Focusable="False"/>
                            <ContentControl x:Name="ContentPresenter"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    HorizontalContentAlignment="Stretch"
                                    VerticalContentAlignment="Stretch"
                                    IsTabStop="False"
                                    Focusable="False"/>
                            <Grid Grid.Row="1" Grid.Column="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="6*"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="4*"/>
                                </Grid.ColumnDefinitions>
                                <spreadsheetControls:RadSpreadsheetSheetSelector x:Name="SheetSelector" RadSpreadsheet="{Binding RelativeSource={RelativeSource TemplatedParent}}"/>
                                <Rectangle Height="1" VerticalAlignment="Top" Fill="{StaticResource SheetSelectorDarkLineBrush}" Grid.Column="1"/>
                                <spreadsheetControls:SpreadsheetGridSplitter x:Name="splitter"
                                        Width="10"
                                        VerticalAlignment="Stretch"
                                        HorizontalAlignment="Center"
                                        Visibility="{Binding Path=(spreadsheetControls:RadSpreadsheetSheetSelector.IsSheetSelectorVisible), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource SpreadsheetBooleanToVisibilityConverter}}"
                                        Margin="0 1 0 0"
                                        Grid.Column="1"/>
                                <ScrollBar x:Name="HorizontalScrollBar"
                                        Grid.Column="2"
                                        HorizontalAlignment="Stretch"
                                        IsTabStop="False"
                                        SmallChange="16"
                                        LargeChange="320"
                                        Orientation="Horizontal"
                                        Minimum="0"
                                        Margin="{StaticResource HorizontalScrollBarMarginThickness}"/>
                            </Grid>
                            <ScrollBar x:Name="VerticalScrollBar" Grid.Row="0" Grid.Column="1" IsTabStop="False" SmallChange="16" LargeChange="320" Orientation="Vertical" Minimum="0" Width="16"/>
                            <Rectangle Grid.Row="1" Grid.Column="1" Fill="{StaticResource WorksheetScrollViewersPane_Brush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NormalWorksheetEditorPresenterStyle" TargetType="worksheet:NormalWorksheetEditorPresenter">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheet:NormalWorksheetEditorPresenter">
                    <Grid>
                        <ContentControl x:Name="ContentPresenter"
                                Grid.Row="2"
                                Grid.Column="2"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch"
                                IsTabStop="False"
                                Focusable="False"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="WorksheetPrintPresenterStyle" TargetType="worksheet:WorksheetPrintPresenter">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheet:WorksheetPrintPresenter">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentControl x:Name="ContentPresenter"
                                Grid.Row="2"
                                Grid.Column="2"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch"
                                IsTabStop="False"
                                Focusable="False"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SelectAllControlStyle" TargetType="worksheetMargins:SelectAllControl">
        <Setter Property="SelectedFillBrush" Value="{StaticResource SelectedFillBrush}"/>
        <Setter Property="NormalFillBrush" Value="{StaticResource NormalFillBrush}"/>
        <Setter Property="HoverFillBrush" Value="{StaticResource HoverFillBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheetMargins:SelectAllControl">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Rectangle Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=NormalFillBrush}" Stroke="{StaticResource RectangleStrokeBrush}" StrokeThickness="0.3"/>
                        <Rectangle Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Fill}" Margin="1.5"/>
                        <Rectangle x:Name="PART_TopRectangle" Margin="4" Fill="{StaticResource RectangleStrokeBrush}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadWorksheetEditorStyle" TargetType="worksheet:RadWorksheetEditor">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheet:RadWorksheetEditor">
                    <Grid x:Name="LayoutRoot" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="RowColumnHeadingMarginsStates">
                                <VisualState x:Name="VisibleHeadings">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectAllControl" Storyboard.TargetProperty="(worksheetMargins:SelectAllControl.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopMarginsPanel" Storyboard.TargetProperty="(StackPanel.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftMarginsPanel" Storyboard.TargetProperty="(StackPanel.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RadWorksheetEditorBorder" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="HiddenHeadings">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectAllControl" Storyboard.TargetProperty="(worksheetMargins:SelectAllControl.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopMarginsPanel" Storyboard.TargetProperty="(StackPanel.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftMarginsPanel" Storyboard.TargetProperty="(StackPanel.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RadWorksheetEditorBorder" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 1 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <worksheetMargins:SelectAllControl x:Name="SelectAllControl" AssociatedWorksheetEditor="{Binding RelativeSource={RelativeSource TemplatedParent}}"/>
                        <StackPanel x:Name="TopMarginsPanel" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
                        <StackPanel x:Name="LeftMarginsPanel" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
                        <Border x:Name="RadWorksheetEditorBorder" Grid.Row="1" Grid.Column="1" BorderBrush="#FFABABAB" BorderThickness="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <ContentControl x:Name="ContentPresenter"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    HorizontalContentAlignment="Stretch"
                                    VerticalContentAlignment="Stretch"
                                    IsTabStop="False"
                                    Focusable="False"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ResizeThumbStyle" TargetType="worksheetMargins:ResizeThumb">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheetMargins:ResizeThumb">
                    <Grid>
                        <Thumb x:Name="PART_Thumb">
                            <Thumb.Template>
                                <ControlTemplate>
                                    <Rectangle Fill="Transparent"/>
                                </ControlTemplate>
                            </Thumb.Template>
                        </Thumb>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="UnhideThumbStyle" TargetType="worksheetMargins:UnhideThumb">
        <Setter Property="BorderThickness" Value="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"/>
        <Setter Property="BorderBrush" Value="{StaticResource RectangleStrokeBrush}"/>
        <Setter Property="Background" Value="{StaticResource NormalFillBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheetMargins:UnhideThumb">
                    <Grid>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                            <Thumb x:Name="PART_Thumb" Background="Transparent">
                                <Thumb.Template>
                                    <ControlTemplate>
                                        <Rectangle Fill="Transparent"/>
                                    </ControlTemplate>
                                </Thumb.Template>
                            </Thumb>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="rowColumnheadingBaseStyle" TargetType="worksheetMargins:RowColumnHeadingBase">
        <Setter Property="NormalFillBrush" Value="{StaticResource NormalFillBrush}"/>
        <Setter Property="FullySelectedFillBrush" Value="{StaticResource FullySelectedFillBrush}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="RectangleStrokeBrush" Value="{StaticResource RectangleStrokeBrush}"/>
        <Setter Property="RectangleStrokeThickness" Value="0.3"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Foreground" Value="{StaticResource RowColHeadingForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheetMargins:RowColumnHeadingBase">
                    <Grid x:Name="Content">
                        <Rectangle
                                Stroke="{TemplateBinding RectangleStrokeBrush}"
                                StrokeThickness="{TemplateBinding RectangleStrokeThickness}"
                                MinWidth="25"
                                Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Fill}"
                                SnapsToDevicePixels="True"/>
                        <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Text}" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="3 2"/>
                        <worksheetMargins:ResizeThumb x:Name="PART_FirstResizeThumb"/>
                        <worksheetMargins:UnhideThumb x:Name="PART_UnhideThumb"/>
                        <worksheetMargins:ResizeThumb x:Name="PART_SecondResizeThumb"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RowHeadingStyle" TargetType="worksheetMargins:RowHeading" BasedOn="{StaticResource rowColumnheadingBaseStyle}">
        <Setter Property="SelectedFillBrush" Value="{StaticResource SelectedRowFillBrush}"/>
        <Setter Property="HoverFillBrush" Value="{StaticResource HoverRowFillBrush}"/>
    </Style>
    <Style x:Key="ColumnHeadingStyle" TargetType="worksheetMargins:ColumnHeading" BasedOn="{StaticResource rowColumnheadingBaseStyle}">
        <Setter Property="SelectedFillBrush" Value="{StaticResource SelectedFillGradientBrush}"/>
        <Setter Property="HoverFillBrush" Value="{StaticResource HoverFillGradientBrush}"/>
    </Style>
    <Style x:Key="printRowColumnHeadingBaseStyle" TargetType="worksheetMargins:RowColumnHeadingBase" BasedOn="{StaticResource rowColumnheadingBaseStyle}">
        <Setter Property="NormalFillBrush" Value="Transparent"/>
        <Setter Property="Fill" Value="Transparent"/>
        <Setter Property="RectangleStrokeBrush" Value="Black"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="RectangleStrokeThickness" Value="0.5"/>
    </Style>
    <Style x:Key="PrintRowHeadingStyle" TargetType="worksheetMargins:PrintRowHeading" BasedOn="{StaticResource printRowColumnHeadingBaseStyle}"/>
    <Style x:Key="PrintColumnHeadingStyle" TargetType="worksheetMargins:PrintColumnHeading" BasedOn="{StaticResource printRowColumnHeadingBaseStyle}"/>
    <Style x:Key="CellEditorTextBoxStyle" TargetType="RichTextBox">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RichTextBox">
                    <Grid x:Name="RootElement">
                        <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" Opacity="1" Background="{TemplateBinding Background}">
                            <ScrollViewer
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Background="{TemplateBinding Background}"
                                    Padding="{TemplateBinding Padding}"
                                    BorderThickness="0"
                                    IsTabStop="False"
                                    Name="PART_ContentHost"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CellEditorStyle" TargetType="worksheet:CellEditor">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="worksheet:CellEditor">
                    <Grid>
                        <RichTextBox x:Name="PART_TextBox"
                                Padding="{TemplateBinding Padding}"
                                FontFamily="{TemplateBinding FontFamily}"
                                FontWeight="{TemplateBinding FontWeight}"
                                FontStyle="{TemplateBinding FontStyle}"
                                Background="{TemplateBinding Background}"
                                Style="{StaticResource ResourceKey=CellEditorTextBoxStyle}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SheetSelectorTabItemStyle" TargetType="spreadsheetControls:SheetSelectorTabItem">
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:SheetSelectorTabItem">
                    <Grid x:Name="root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Active">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBlock" Storyboard.TargetProperty="(TextElement.FontWeight)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Bold</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopActiveRectangle" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBlock" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftOuter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftOuter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeft" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeft" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftInner" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftInner" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterOuter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterOuter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterInner" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterInner" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightOuter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightOuter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRight" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRight" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightInner" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightInner" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBlock" Storyboard.TargetProperty="(TextElement.FontWeight)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBlock" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftOuter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftOuter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeft" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeft" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftInner" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderLeftInner" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterOuter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterOuter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterInner" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderCenterInner" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightOuter" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightOuter" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRight" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRight" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightInner" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_BorderRightInner" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Edit">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBlock" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_TabNameTextBox" Storyboard.TargetProperty="(TextElement.FontWeight)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Bold</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="root" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="10"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="17"/>
                        </Grid.ColumnDefinitions>
                        <Border Grid.Column="0" x:Name="PART_BorderLeftOuter" Background="{StaticResource SheetSelectorOuterBackgroundBrush}" BorderThickness="1 0 0 1" CornerRadius="0 0 0 4">
                            <Grid>
                                <Border
                                        Background="{Binding CurrentBackground}"
                                        x:Name="PART_BorderLeft"
                                        Margin="1 0 0 1"
                                        BorderThickness="1 0 0 1"
                                        CornerRadius="0 0 0 3"
                                        BorderBrush="{StaticResource SheetSelectorInnerBorderBrush}"/>
                                <Border
                                        Margin="1 0 0 1"
                                        x:Name="PART_BorderLeftInner"
                                        BorderThickness="1 0 0 1"
                                        CornerRadius="0 0 0 3"
                                        BorderBrush="{StaticResource SheetSelectorInnerBorderBrush}"
                                        Background="{StaticResource SheetSelectorInnerBackgroundBrush}"
                                        Opacity="0.3"
                                        Visibility="{Binding IsMousePointerOver, Converter={StaticResource BoolToVisibilityValueConverter}}"
                                        IsHitTestVisible="False"/>
                            </Grid>
                        </Border>
                        <Border Background="{StaticResource SheetSelectorOuterBackgroundBrush}" BorderThickness="0 0 0 1" x:Name="PART_BorderCenterOuter" Grid.Column="1">
                            <Grid>
                                <Border
                                        Background="{Binding CurrentBackground}"
                                        x:Name="PART_BorderCenter"
                                        Margin="0 0 0 1"
                                        BorderThickness="0 0 0 1"
                                        BorderBrush="{StaticResource SheetSelectorInnerBorderBrush}">
                                    <Grid>
                                        <TextBlock x:Name="PART_TabNameTextBlock" Text="{Binding Path=SheetName}" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 -3 0 0"/>
                                        <TextBox x:Name="PART_TabNameTextBox"
                                                Background="{Binding CurrentBackground}"
                                                Text="{Binding Path=SheetName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                BorderThickness="0"
                                                BorderBrush="Transparent"
                                                Visibility="Collapsed"
                                                Height="23"
                                                VerticalAlignment="Center"
                                                MaxLength="31"/>
                                        <Image x:Name="PART_Image"
                                                VerticalAlignment="Center"
                                                HorizontalAlignment="Center"
                                                Width="14"
                                                Height="14"
                                                Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/SheetSelector/newSheet.png"
                                                UseLayoutRounding="True"
                                                SnapsToDevicePixels="True"/>
                                    </Grid>
                                </Border>
                                <Border
                                        Margin="0 0 0 1"
                                        x:Name="PART_BorderCenterInner"
                                        BorderThickness="0 0 0 1"
                                        BorderBrush="{StaticResource SheetSelectorInnerBorderBrush}"
                                        Background="{StaticResource SheetSelectorInnerBackgroundBrush}"
                                        Opacity="0.3"
                                        Visibility="{Binding IsMousePointerOver, Converter={StaticResource BoolToVisibilityValueConverter}}"
                                        IsHitTestVisible="False"/>
                            </Grid>
                        </Border>
                        <Border Background="{StaticResource SheetSelectorOuterBackgroundBrush}" x:Name="PART_BorderRightOuter" BorderThickness="0 0 0 1" Grid.Column="2">
                            <Border.Clip>
                                <PathGeometry>
                                    <PathFigure StartPoint="0, 17">
                                        <LineSegment Point="0, 0"/>
                                        <LineSegment Point="17, 0"/>
                                    </PathFigure>
                                </PathGeometry>
                            </Border.Clip>
                            <Grid>
                                <Border
                                        Background="{Binding CurrentBackground}"
                                        x:Name="PART_BorderRight"
                                        Margin="0 0 0 1"
                                        BorderThickness="0 0 0 1"
                                        BorderBrush="{StaticResource SheetSelectorInnerBorderBrush}">
                                    <Border.Clip>
                                        <PathGeometry>
                                            <PathFigure StartPoint="0, 17">
                                                <LineSegment Point="0, 0"/>
                                                <LineSegment Point="17, 0"/>
                                            </PathFigure>
                                        </PathGeometry>
                                    </Border.Clip>
                                </Border>
                                <Border
                                        Margin="0 0 0 1"
                                        x:Name="PART_BorderRightInner"
                                        BorderThickness="0 0 0 1"
                                        BorderBrush="{StaticResource SheetSelectorInnerBorderBrush}"
                                        Background="{StaticResource SheetSelectorInnerBackgroundBrush}"
                                        Opacity="0.3"
                                        Visibility="{Binding IsMousePointerOver, Converter={StaticResource BoolToVisibilityValueConverter}}"
                                        IsHitTestVisible="False">
                                    <Border.Clip>
                                        <PathGeometry>
                                            <PathFigure StartPoint="0, 17">
                                                <LineSegment Point="0, 0"/>
                                                <LineSegment Point="17, 0"/>
                                            </PathFigure>
                                        </PathGeometry>
                                    </Border.Clip>
                                </Border>
                            </Grid>
                        </Border>
                        <Line x:Name="bottomLine" Stroke="{StaticResource SheetSelectorLightLineBrush}" X1="0" Y1="15" X2="16" Y2="0" Width="17" Height="17" Grid.Column="2"/>
                        <Line x:Name="line" Stroke="{StaticResource SheetSelectorDarkLineBrush}" X1="0" Y1="16" X2="17" Y2="0" Width="17" Height="17" Grid.Column="2"/>
                        <Rectangle x:Name="TopActiveRectangle" Visibility="Collapsed" VerticalAlignment="Top" Fill="White" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Height="1" Margin="2 0 1 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadSpreadsheetSheetSelectorStyle" TargetType="spreadsheetControls:RadSpreadsheetSheetSelector">
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Background" Value="{StaticResource SheetSelectorMainBackgroundBrush}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:RadSpreadsheetSheetSelector">
                    <Grid Background="{TemplateBinding Background}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.CommandDescriptors}">
                        <Rectangle Height="1" VerticalAlignment="Top" Fill="{StaticResource SheetSelectorDarkLineBrush}"/>
                        <StackPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Height="16">
                            <telerik:RadButton x:Name="PART_GoToFirstButton"
                                    Width="16"
                                    Margin="0"
                                    CornerRadius="0"
                                    BorderThickness="0 1 0 0"
                                    BorderBrush="{StaticResource SheetSelectorDarkLineBrush}"
                                    IsTabStop="False">
                                <telerik:RadButton.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <Rectangle Fill="{StaticResource SheetSelectorNavigationButtonBrush}" HorizontalAlignment="Left" Height="8" Margin="0" VerticalAlignment="Top" Width="1"/>
                                        <Path
                                                Fill="{StaticResource SheetSelectorNavigationButtonBrush}"
                                                HorizontalAlignment="Left"
                                                Height="4"
                                                VerticalAlignment="Center"
                                                Width="8"
                                                Data="M37.0,0 L74.0,71 L2.3E-07,71 z"
                                                RenderTransformOrigin="0.5,0.5"
                                                Stretch="Fill"
                                                Margin="-1 0 0 0">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform Angle="-90"/>
                                                    <TranslateTransform/>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </StackPanel>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <telerik:RadButton x:Name="PART_GoToPreviousButton"
                                    Width="16"
                                    Margin="0"
                                    CornerRadius="0"
                                    BorderThickness="0 1 0 0"
                                    BorderBrush="{StaticResource SheetSelectorDarkLineBrush}"
                                    IsTabStop="False">
                                <telerik:RadButton.Content>
                                    <Path
                                            Fill="{StaticResource SheetSelectorNavigationButtonBrush}"
                                            HorizontalAlignment="Center"
                                            Height="4"
                                            VerticalAlignment="Center"
                                            Width="8"
                                            Data="M37.0,0 L74.0,71 L2.3E-07,71 z"
                                            RenderTransformOrigin="0.5,0.5"
                                            Stretch="Fill"
                                            Margin="0">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform Angle="-90"/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <telerik:RadButton x:Name="PART_GoToNextButton"
                                    Width="16"
                                    Margin="0"
                                    CornerRadius="0"
                                    BorderThickness="0 1 0 0"
                                    BorderBrush="{StaticResource SheetSelectorDarkLineBrush}"
                                    IsTabStop="False">
                                <telerik:RadButton.Content>
                                    <Path
                                            Fill="{StaticResource SheetSelectorNavigationButtonBrush}"
                                            HorizontalAlignment="Center"
                                            Height="4"
                                            VerticalAlignment="Center"
                                            Width="8"
                                            Data="M37.0,0 L74.0,71 L2.3E-07,71 z"
                                            RenderTransformOrigin="0.5,0.5"
                                            Stretch="Fill"
                                            Margin="0">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform Angle="90"/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <telerik:RadButton x:Name="PART_GoToLastButton"
                                    Width="16"
                                    CornerRadius="0"
                                    BorderThickness="0 1 0 0"
                                    BorderBrush="{StaticResource SheetSelectorDarkLineBrush}"
                                    IsTabStop="False"
                                    Margin="0 0 -1 0">
                                <telerik:RadButton.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <Path
                                                Fill="{StaticResource SheetSelectorNavigationButtonBrush}"
                                                HorizontalAlignment="Left"
                                                Height="4"
                                                VerticalAlignment="Center"
                                                Width="8"
                                                Data="M37.0,0 L74.0,71 L2.3E-07,71 z"
                                                RenderTransformOrigin="0.5,0.5"
                                                Stretch="Fill"
                                                Margin="0 0 -1 0">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform Angle="90"/>
                                                    <TranslateTransform/>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                        <Rectangle Fill="{StaticResource SheetSelectorNavigationButtonBrush}" HorizontalAlignment="Right" Height="8" Margin="0" VerticalAlignment="Top" Width="1"/>
                                    </StackPanel>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <ScrollViewer
                                    BorderThickness="0"
                                    Background="Transparent"
                                    VerticalAlignment="Center"
                                    x:Name="PART_SheetTabItemsContainerScrollViewer"
                                    HorizontalScrollBarVisibility="Hidden"
                                    VerticalScrollBarVisibility="Hidden"
                                    IsTabStop="False"
                                    Focusable="False"
                                    Height="30"
                                    Margin="0 -1 0 0"
                                    Padding="0">
                                <StackPanel Orientation="Horizontal" Name="PART_SheetTabItemsContainer" Margin="0 2 0 0" Height="17">
                                    <telerik:RadContextMenu.ContextMenu>
                                        <telerik:RadContextMenu x:Name="PART_ContextMenu" InheritDataContext="True">
                                            <telerik:RadMenuItem
                                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_SheetSelector_Insert"
                                                    Command="{Binding Path=InsertSheet.Command, Mode=OneWay}"
                                                    CommandParameter="Worksheet"
                                                    IsEnabled="{Binding Path=InsertSheet.IsEnabled, Mode=TwoWay}"/>
                                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_SheetSelector_Delete" Command="{Binding Path=RemoveSheet.Command}" IsEnabled="{Binding Path=RemoveSheet.IsEnabled, Mode=TwoWay}">
                                                <telerik:RadMenuItem.Icon>
                                                    <Image Source="{telerik:IconResource IconRelativePath=SheetSelector/deleteSheet.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                                </telerik:RadMenuItem.Icon>
                                            </telerik:RadMenuItem>
                                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_SheetSelector_Rename" Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RenameSheetCommand, Mode=OneWay}"/>
                                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_SheetSelector_TabColor">
                                                <telerik:RadMenuGroupItem BorderThickness="0" Padding="0">
                                                    <telerik:RadColorSelector x:Name="PART_ColorSelector"
                                                            HeaderPaletteItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.ColorPalette.HeaderPaletteItemsSource}"
                                                            MainPaletteItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.ColorPalette.MainPaletteItemsSource}"
                                                            MainPaletteOrientation="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.ColorPalette.MainPaletteOrientation}"
                                                            RecentColorsVisibility="Visible"
                                                            SelectedColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ActiveTabItemColor, Mode=TwoWay}"
                                                            Margin="-2"/>
                                                </telerik:RadMenuGroupItem>
                                            </telerik:RadMenuItem>
                                        </telerik:RadContextMenu>
                                    </telerik:RadContextMenu.ContextMenu>
                                </StackPanel>
                            </ScrollViewer>
                        </StackPanel>
                        <Canvas x:Name="PART_ImagesContainer" Margin="0 -50 0 0">
                            <Image x:Name="PART_PageIcon"
                                    Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/SheetSelector/dragDropSheetPage.png"
                                    Visibility="Collapsed"
                                    Canvas.Left="20"
                                    Canvas.ZIndex="1000"/>
                            <Image x:Name="PART_Arrow"
                                    Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/SheetSelector/dragDropSheetArrow.png"
                                    Visibility="Collapsed"
                                    UseLayoutRounding="True"
                                    SnapsToDevicePixels="True"/>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="PrintPreviewControlStyle" TargetType="spreadsheetControls:PrintPreviewControl">
        <Setter Property="Foreground" Value="{StaticResource RowColHeadingForegroundBrush}"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Background" Value="{StaticResource SheetSelectorMainBackgroundBrush}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:PrintPreviewControl">
                    <Grid Margin="45 0" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ViewModel}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="320"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_Printing_Print" FontSize="36" Grid.ColumnSpan="2" Margin="0 25"/>
                        <Grid Grid.Row="1">
                            <StackPanel Margin="0 0 45 0">
                                <StackPanel Orientation="Horizontal">
                                    <telerik:RadButton Width="85" Height="85" Command="{Binding PrintCommand}" CommandParameter="{Binding PrintWhatSettings}">
                                        <telerik:RadButton.Content>
                                            <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                                                <Image Source="{telerik:IconResource IconRelativePath=32/print.png, IconSources={StaticResource IconPaths}}" Stretch="None" Width="32"/>
                                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_Printing_Print" Margin="0 2"/>
                                            </StackPanel>
                                        </telerik:RadButton.Content>
                                    </telerik:RadButton>
                                    <StackPanel Orientation="Horizontal" Margin="10 0">
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_Copies" VerticalAlignment="Center" Margin="10 0"/>
                                        <telerik:RadNumericUpDown VerticalAlignment="Center" IsInteger="True" Minimum="1" Value="{Binding Copies, Mode=TwoWay}" Width="65"/>
                                    </StackPanel>
                                </StackPanel>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_Settings" FontSize="24" Margin="0 10"/>
                                <telerik:RadDropDownButton Margin="0 5 0 0" HorizontalContentAlignment="Left" Padding="2" AutomationProperties.AutomationId="btnPageWhat" Height="46" DropDownWidth="275">
                                    <telerik:RadDropDownButton.Content>
                                        <telerik:RadMenuItem IsHitTestVisible="False" Padding="0" IconColumnWidth="50">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{Binding SelectedPrintWhatModel.Icon}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <StackPanel>
                                                    <TextBlock Text="{Binding SelectedPrintWhatModel.Header}" Margin="0 0 0 3"/>
                                                    <TextBlock Text="{Binding SelectedPrintWhatModel.Description}" Opacity="0.7"/>
                                                </StackPanel>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                    </telerik:RadDropDownButton.Content>
                                    <telerik:RadDropDownButton.DropDownContent>
                                        <telerik:RadContextMenu BorderThickness="0">
                                            <telerik:RadMenuGroupItem Margin="-1" ItemsSource="{Binding PrintWhatDropDownItems}" StaysOpenOnClick="False">
                                                <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                                    <spreadsheetUtilities:SingleTemplateSelector>
                                                        <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadMenuItem Command="{Binding Command}" CommandParameter="{Binding}" IconColumnWidth="50">
                                                                    <telerik:RadMenuItem.Icon>
                                                                        <Image Source="{Binding Icon}" Stretch="None"/>
                                                                    </telerik:RadMenuItem.Icon>
                                                                    <telerik:RadMenuItem.Header>
                                                                        <StackPanel>
                                                                            <TextBlock Text="{Binding Header}" Margin="0 0 0 3"/>
                                                                            <TextBlock Text="{Binding Description}"/>
                                                                        </StackPanel>
                                                                    </telerik:RadMenuItem.Header>
                                                                </telerik:RadMenuItem>
                                                            </DataTemplate>
                                                        </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                    </spreadsheetUtilities:SingleTemplateSelector>
                                                </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                            </telerik:RadMenuGroupItem>
                                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_IgnorePrintArea" Command="{Binding SelectIgnorePrintAreaCommand}" IsEnabled="{Binding IsIgnorePrintAreaEnabled, Mode=TwoWay}">
                                                <telerik:RadMenuItem.Icon>
                                                    <TextBlock Text="✔" Visibility="{Binding PrintWhatSettings.IgnorePrintArea, Converter={StaticResource BoolToVisibilityValueConverter}}"/>
                                                </telerik:RadMenuItem.Icon>
                                            </telerik:RadMenuItem>
                                        </telerik:RadContextMenu>
                                    </telerik:RadDropDownButton.DropDownContent>
                                </telerik:RadDropDownButton>
                                <StackPanel Orientation="Horizontal" Margin="0 2">
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_Pages" Margin="0 0 10 0" VerticalAlignment="Center"/>
                                    <telerik:RadNumericUpDown IsInteger="True" Minimum="1" Value="{Binding FromPage, Mode=TwoWay}" VerticalAlignment="Center" Width="65"/>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_To" Margin="10 0" VerticalAlignment="Center"/>
                                    <telerik:RadNumericUpDown IsInteger="True" Minimum="1" Value="{Binding ToPage, Mode=TwoWay}" VerticalAlignment="Center" Width="65"/>
                                </StackPanel>
                                <telerik:RadDropDownButton Margin="0 2" HorizontalContentAlignment="Left" Padding="2" Height="46" DropDownWidth="275">
                                    <telerik:RadDropDownButton.Content>
                                        <telerik:RadMenuItem IsHitTestVisible="False" Padding="0" IconColumnWidth="50">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{Binding SelectedPrintCollatedModel.Icon}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <StackPanel>
                                                    <TextBlock Text="{Binding SelectedPrintCollatedModel.Header}" Margin="0 0 0 3"/>
                                                    <TextBlock Text="{Binding SelectedPrintCollatedModel.Description}" Opacity="0.7"/>
                                                </StackPanel>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                    </telerik:RadDropDownButton.Content>
                                    <telerik:RadDropDownButton.DropDownContent>
                                        <telerik:RadContextMenu BorderThickness="0">
                                            <telerik:RadMenuGroupItem Margin="-1" ItemsSource="{Binding PrintCollatedDropDownItems}" StaysOpenOnClick="False">
                                                <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                                    <spreadsheetUtilities:SingleTemplateSelector>
                                                        <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadMenuItem Command="{Binding Command}" CommandParameter="{Binding}" IconColumnWidth="50">
                                                                    <telerik:RadMenuItem.Icon>
                                                                        <Image Source="{Binding Icon}" Stretch="None"/>
                                                                    </telerik:RadMenuItem.Icon>
                                                                    <telerik:RadMenuItem.Header>
                                                                        <StackPanel>
                                                                            <TextBlock Text="{Binding Header}" Margin="0 0 0 3"/>
                                                                            <TextBlock Text="{Binding Description}"/>
                                                                        </StackPanel>
                                                                    </telerik:RadMenuItem.Header>
                                                                </telerik:RadMenuItem>
                                                            </DataTemplate>
                                                        </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                    </spreadsheetUtilities:SingleTemplateSelector>
                                                </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                            </telerik:RadMenuGroupItem>
                                        </telerik:RadContextMenu>
                                    </telerik:RadDropDownButton.DropDownContent>
                                </telerik:RadDropDownButton>
                                <telerik:RadDropDownButton Margin="0 2" HorizontalContentAlignment="Left" Padding="2" AutomationProperties.AutomationId="btnPageOrientation" Height="46" DropDownWidth="275">
                                    <telerik:RadDropDownButton.Content>
                                        <telerik:RadMenuItem IsHitTestVisible="False" Header="{Binding SelectedPageOrientationModel.Header}" Padding="0" IconColumnWidth="50">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{Binding SelectedPageOrientationModel.Icon}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                        </telerik:RadMenuItem>
                                    </telerik:RadDropDownButton.Content>
                                    <telerik:RadDropDownButton.DropDownContent>
                                        <telerik:RadContextMenu BorderThickness="0">
                                            <telerik:RadMenuGroupItem Margin="-1" ItemsSource="{Binding PageOrientationDropDownItems}" StaysOpenOnClick="False">
                                                <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                                    <spreadsheetUtilities:SingleTemplateSelector>
                                                        <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadMenuItem Command="{Binding Command}" CommandParameter="{Binding}" Header="{Binding Header}" IconColumnWidth="50">
                                                                    <telerik:RadMenuItem.Icon>
                                                                        <Image Source="{Binding Icon}" Stretch="None"/>
                                                                    </telerik:RadMenuItem.Icon>
                                                                </telerik:RadMenuItem>
                                                            </DataTemplate>
                                                        </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                    </spreadsheetUtilities:SingleTemplateSelector>
                                                </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                            </telerik:RadMenuGroupItem>
                                        </telerik:RadContextMenu>
                                    </telerik:RadDropDownButton.DropDownContent>
                                </telerik:RadDropDownButton>
                                <telerik:RadDropDownButton Margin="0 2" HorizontalContentAlignment="Left" Padding="2" IsOpen="{Binding IsPaperTypeDropDownOpened, Mode=TwoWay}" Height="46" DropDownWidth="275">
                                    <telerik:RadDropDownButton.Content>
                                        <telerik:RadMenuItem IsHitTestVisible="False" Padding="0" IconColumnWidth="50">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{Binding SelectedPaperTypeModel.Icon}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <StackPanel>
                                                    <TextBlock Text="{Binding SelectedPaperTypeModel.Header}" Margin="0 0 0 3"/>
                                                    <TextBlock Text="{Binding SelectedPaperTypeModel.Description}" Opacity="0.7"/>
                                                </StackPanel>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                    </telerik:RadDropDownButton.Content>
                                    <telerik:RadDropDownButton.DropDownContent>
                                        <telerik:RadContextMenu BorderThickness="0">
                                            <telerik:RadMenuGroupItem Margin="-1" ItemsSource="{Binding PaperTypeDropDownItems}" StaysOpenOnClick="False" MaxHeight="360" ScrollViewer.VerticalScrollBarVisibility="Auto">
                                                <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                                    <spreadsheetUtilities:SingleTemplateSelector>
                                                        <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadMenuItem Command="{Binding Command}" CommandParameter="{Binding}" IconColumnWidth="50">
                                                                    <telerik:RadMenuItem.Icon>
                                                                        <Image Source="{Binding Icon}" Stretch="None"/>
                                                                    </telerik:RadMenuItem.Icon>
                                                                    <telerik:RadMenuItem.Header>
                                                                        <StackPanel>
                                                                            <TextBlock Text="{Binding Header}" Margin="0 0 0 3"/>
                                                                            <TextBlock Text="{Binding Description}"/>
                                                                        </StackPanel>
                                                                    </telerik:RadMenuItem.Header>
                                                                </telerik:RadMenuItem>
                                                            </DataTemplate>
                                                        </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                    </spreadsheetUtilities:SingleTemplateSelector>
                                                </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                            </telerik:RadMenuGroupItem>
                                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_MorePaperSizes" Command="{Binding ShowPageSetupDialogPageTabCommand}"/>
                                        </telerik:RadContextMenu>
                                    </telerik:RadDropDownButton.DropDownContent>
                                </telerik:RadDropDownButton>
                                <telerik:RadDropDownButton Margin="0 2" HorizontalContentAlignment="Left" Padding="2" IsOpen="{Binding IsMarginsDropDownOpened, Mode=TwoWay}" Height="46" DropDownWidth="275">
                                    <telerik:RadDropDownButton.Content>
                                        <telerik:RadMenuItem IsHitTestVisible="False" Padding="0" IconColumnWidth="50">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{Binding SelectedMarginsModel.Icon}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <StackPanel>
                                                    <TextBlock Text="{Binding SelectedMarginsModel.Header}" Margin="0 0 0 3"/>
                                                    <Grid>
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition/>
                                                            <ColumnDefinition/>
                                                        </Grid.ColumnDefinitions>
                                                        <TextBlock Text="{Binding SelectedMarginsModel.LeftMarginText}" Grid.Column="0" Opacity="0.7"/>
                                                        <TextBlock Text="{Binding SelectedMarginsModel.RightMarginText}" Grid.Column="1" Opacity="0.7"/>
                                                    </Grid>
                                                </StackPanel>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                    </telerik:RadDropDownButton.Content>
                                    <telerik:RadDropDownButton.DropDownContent>
                                        <telerik:RadContextMenu BorderThickness="0">
                                            <telerik:RadMenuGroupItem Margin="-1" ItemsSource="{Binding MarginsDropDownItems}" StaysOpenOnClick="False">
                                                <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                                    <spreadsheetUtilities:SingleTemplateSelector>
                                                        <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadMenuItem Command="{Binding Command}" CommandParameter="{Binding}" IconColumnWidth="50">
                                                                    <telerik:RadMenuItem.Icon>
                                                                        <Image Source="{Binding Icon}" Stretch="None"/>
                                                                    </telerik:RadMenuItem.Icon>
                                                                    <telerik:RadMenuItem.Header>
                                                                        <StackPanel>
                                                                            <TextBlock Text="{Binding Header}" Margin="0 0 0 3"/>
                                                                            <Grid>
                                                                                <Grid.RowDefinitions>
                                                                                    <RowDefinition/>
                                                                                    <RowDefinition/>
                                                                                </Grid.RowDefinitions>
                                                                                <Grid.ColumnDefinitions>
                                                                                    <ColumnDefinition/>
                                                                                    <ColumnDefinition/>
                                                                                </Grid.ColumnDefinitions>
                                                                                <TextBlock Text="{Binding TopMarginText}" Grid.Row="0" Grid.Column="0"/>
                                                                                <TextBlock Text="{Binding BottomMarginText}" Grid.Row="0" Grid.Column="1"/>
                                                                                <TextBlock Text="{Binding LeftMarginText}" Grid.Row="1" Grid.Column="0"/>
                                                                                <TextBlock Text="{Binding RightMarginText}" Grid.Row="1" Grid.Column="1"/>
                                                                            </Grid>
                                                                        </StackPanel>
                                                                    </telerik:RadMenuItem.Header>
                                                                </telerik:RadMenuItem>
                                                            </DataTemplate>
                                                        </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                    </spreadsheetUtilities:SingleTemplateSelector>
                                                </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                            </telerik:RadMenuGroupItem>
                                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_CustomMargins" Command="{Binding ShowPageSetupDialogMarginsTabCommand}"/>
                                        </telerik:RadContextMenu>
                                    </telerik:RadDropDownButton.DropDownContent>
                                </telerik:RadDropDownButton>
                                <telerik:RadDropDownButton Margin="0 2" HorizontalContentAlignment="Left" Padding="2" IsOpen="{Binding IsScalingDropDownOpened, Mode=TwoWay}" Height="46" DropDownWidth="275">
                                    <telerik:RadDropDownButton.Content>
                                        <telerik:RadMenuItem IsHitTestVisible="False" Padding="0" IconColumnWidth="50">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{Binding SelectedScalingTypeDropDownModel.Icon}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <StackPanel>
                                                    <TextBlock Text="{Binding SelectedScalingTypeDropDownModel.Header}" Margin="0 0 0 3"/>
                                                    <TextBlock Text="{Binding SelectedScalingTypeDropDownModel.Description}" Opacity="0.7"/>
                                                </StackPanel>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                    </telerik:RadDropDownButton.Content>
                                    <telerik:RadDropDownButton.DropDownContent>
                                        <telerik:RadContextMenu BorderThickness="0">
                                            <telerik:RadMenuGroupItem Margin="-1" ItemsSource="{Binding ScalingTypeDropDownItems}" StaysOpenOnClick="False">
                                                <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                                    <spreadsheetUtilities:SingleTemplateSelector>
                                                        <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadMenuItem Command="{Binding Command}" CommandParameter="{Binding}" IconColumnWidth="50">
                                                                    <telerik:RadMenuItem.Icon>
                                                                        <Image Source="{Binding Icon}" Stretch="None"/>
                                                                    </telerik:RadMenuItem.Icon>
                                                                    <telerik:RadMenuItem.Header>
                                                                        <StackPanel>
                                                                            <TextBlock Text="{Binding Header}" Margin="0 0 0 3"/>
                                                                            <TextBlock Text="{Binding Description}"/>
                                                                        </StackPanel>
                                                                    </telerik:RadMenuItem.Header>
                                                                </telerik:RadMenuItem>
                                                            </DataTemplate>
                                                        </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                    </spreadsheetUtilities:SingleTemplateSelector>
                                                </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                            </telerik:RadMenuGroupItem>
                                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_CustomScalingOptions" Command="{Binding ShowPageSetupDialogPageTabCommand}"/>
                                        </telerik:RadContextMenu>
                                    </telerik:RadDropDownButton.DropDownContent>
                                </telerik:RadDropDownButton>
                                <Button
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_Printing_PageSetup"
                                        Command="{Binding ShowPageSetupDialogPageTabCommand}"
                                        HorizontalAlignment="Right"
                                        Style="{StaticResource LinkButtonStyle}"
                                        Margin="0 5 0 0"
                                        AutomationProperties.AutomationId="btnPrintingPageSetup"/>
                            </StackPanel>
                            <Border HorizontalAlignment="Right" Width="1" Background="{StaticResource PrintPreviewSeparatorBrush}"/>
                        </Grid>
                        <Grid Grid.Row="1" Grid.Column="1" Opacity="{Binding HasAnyPages, Converter={StaticResource BooleanToOpacityConverter}}" Margin="45 0 0 0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <worksheet:WorksheetPrintPresenter x:Name="PART_PrintPresenter" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                            <StackPanel Height="27" Grid.Row="1" Orientation="Horizontal" Margin="0 0 0 4">
                                <telerik:RadButton
                                        Command="{Binding MoveToPreviousPageCommand}"
                                        IsEnabled="{Binding CanMoveToPreviousPage}"
                                        IsBackgroundVisible="False"
                                        BorderThickness="0"
                                        Background="Transparent"
                                        AutomationProperties.AutomationId="btnMoveToPreviousPage">
                                    <Path
                                            Fill="{StaticResource SheetSelectorNavigationButtonBrush}"
                                            HorizontalAlignment="Center"
                                            Height="4"
                                            VerticalAlignment="Center"
                                            Width="8"
                                            Data="M37.0,0 L74.0,71 L2.3E-07,71 z"
                                            RenderTransformOrigin="0.5,0.5"
                                            Stretch="Fill"
                                            Margin="0">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform Angle="-90"/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </telerik:RadButton>
                                <TextBox x:Name="PART_CurrentPageTextBox" Text="{Binding CurrentPageNumberTextValue, Mode=TwoWay}" MinWidth="25" MaxWidth="50" FontSize="12"/>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PrintPreview_Of" Margin="4 0" VerticalAlignment="Center" FontSize="12"/>
                                <TextBlock Text="{Binding PagesCount, Mode=OneWay}" VerticalAlignment="Center" FontSize="12" AutomationProperties.AutomationId="tbPagesCount"/>
                                <telerik:RadButton
                                        Command="{Binding MoveToNextPageCommand}"
                                        IsEnabled="{Binding CanMoveToNextPage}"
                                        IsBackgroundVisible="False"
                                        BorderThickness="0"
                                        Background="Transparent"
                                        AutomationProperties.AutomationId="btnMoveToNextPageCommand">
                                    <Path
                                            Fill="{StaticResource SheetSelectorNavigationButtonBrush}"
                                            HorizontalAlignment="Center"
                                            Height="4"
                                            VerticalAlignment="Center"
                                            Width="8"
                                            Data="M37.0,0 L74.0,71 L2.3E-07,71 z"
                                            RenderTransformOrigin="0.5,0.5"
                                            Stretch="Fill"
                                            Margin="0">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform Angle="90"/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </telerik:RadButton>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NameBoxButtonStyle" TargetType="telerik:RadDropDownButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadDropDownButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsOpenState">
                                <VisualState x:Name="Closed"/>
                                <VisualState x:Name="Opened"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DropDownButtonPosition">
                                <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>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="PopupPlacementState">
                                <VisualState x:Name="PlacementBottom"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border x:Name="OuterBorder"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Background="{TemplateBinding Background}"
                                    CornerRadius="{TemplateBinding CornerRadius}"/>
                            <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>
                                <Grid x:Name="DropDownIndicator"
                                        IsHitTestVisible="False"
                                        Grid.Column="1"
                                        Grid.Row="2"
                                        HorizontalAlignment="Center"
                                        Canvas.ZIndex="2"
                                        VerticalAlignment="Center"
                                        RenderTransformOrigin="0.5,0.5"
                                        Margin="5 3"
                                        Visibility="{TemplateBinding DropDownIndicatorVisibility}">
                                    <Path Data="M0,0 L2,0 1,1 Z" Margin="0" Stretch="Fill" Fill="{StaticResource NameBoxPathFillBrush}" Width="6" Height="4"/>
                                </Grid>
                            </Grid>
                            <Popup x:Name="DropDownPopup" AllowsTransparency="True" StaysOpen="False" Focusable="False" Placement="Bottom">
                                <Grid>
                                    <Border x:Name="DropDownPopupBorder"
                                            BorderBrush="{StaticResource NameBoxBorderBrush}"
                                            Background="{StaticResource DialogsBackgroundBrush}"
                                            BorderThickness="1"
                                            CornerRadius="0"
                                            MinWidth="3"
                                            MinHeight="3"
                                            Width="{TemplateBinding DropDownWidth}"
                                            Height="{TemplateBinding DropDownHeight}"
                                            MaxWidth="{TemplateBinding DropDownMaxWidth}"
                                            MaxHeight="{TemplateBinding DropDownMaxHeight}">
                                        <ContentControl x:Name="DropDownPopupContent"
                                                Content="{TemplateBinding DropDownContent}"
                                                HorizontalContentAlignment="Stretch"
                                                VerticalContentAlignment="Stretch"
                                                ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                                HorizontalAlignment="Stretch"
                                                VerticalAlignment="Stretch"
                                                DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                                    </Border>
                                </Grid>
                            </Popup>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NameBoxStyle" TargetType="spreadsheetControls:NameBox">
        <Setter Property="Width" Value="162"/>
        <Setter Property="Height" Value="22"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="Background" Value="{StaticResource FormulaBoxBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource FormulaBoxForegroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource FormulaBoxBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:NameBox">
                    <Border x:Name="root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="0">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBox x:Name="NameBoxInputBox" BorderThickness="0" Background="Transparent" Text="{Binding Path=TextBoxText, Mode=TwoWay}"/>
                            <telerik:RadDropDownButton
                                    Grid.Column="1"
                                    Padding="0"
                                    DropDownWidth="{TemplateBinding Width}"
                                    IsOpen="{Binding IsOpen,Mode=TwoWay}"
                                    PopupPlacementTarget="{Binding ElementName=NameBoxInputBox}"
                                    Style="{StaticResource NameBoxButtonStyle}"
                                    Margin="0"
                                    BorderThickness="0">
                                <telerik:RadDropDownButton.DropDownContent>
                                    <telerik:RadMenuGroupItem ItemsSource="{Binding NameBoxNames}" DataContext="{Binding}" BorderThickness="0" MaxHeight="250">
                                        <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                            <spreadsheetUtilities:SingleTemplateSelector>
                                                <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                                    <DataTemplate>
                                                        <telerik:RadMenuItem Header="{Binding Name}" CommandParameter="{Binding Name}" Command="{Binding DataContext.SelectName,RelativeSource={RelativeSource FindAncestor,AncestorType=spreadsheetControls:NameBox}}">
                                                            <telerik:EventToCommandBehavior.EventBindings>
                                                                <telerik:EventBinding EventName="MouseLeftButtonUp" RaiseOnHandledEvents="True" Command="{x:Static telerik:PopupCommands.CloseAll}"/>
                                                            </telerik:EventToCommandBehavior.EventBindings>
                                                        </telerik:RadMenuItem>
                                                    </DataTemplate>
                                                </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                            </spreadsheetUtilities:SingleTemplateSelector>
                                        </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                    </telerik:RadMenuGroupItem>
                                </telerik:RadDropDownButton.DropDownContent>
                            </telerik:RadDropDownButton>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FormulaBoxTextBoxStyle" TargetType="RichTextBox">
        <Setter Property="BorderThickness" Value="1 1 0 1"/>
        <Setter Property="Background" Value="{StaticResource FormulaBoxBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource FormulaBoxForegroundBrush}"/>
        <Setter Property="Padding" Value="2 0"/>
        <Setter Property="BorderBrush" Value="{StaticResource FormulaBoxBorderBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RichTextBox">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="ReadOnly"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                CornerRadius="1">
                            <Grid>
                                <Border x:Name="MouseOverBorder" BorderThickness="1" BorderBrush="Transparent">
                                    <ScrollViewer Padding="{TemplateBinding Padding}" VerticalAlignment="Center" BorderThickness="0" IsTabStop="False" Name="PART_ContentHost"/>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FormulaBoxStyle" TargetType="spreadsheetControls:FormulaBarFunctionEditor">
        <Setter Property="spreadsheetControls:FormulaBarFunctionEditor.Height" Value="23"/>
        <Setter Property="spreadsheetControls:FormulaBarFunctionEditor.Margin" Value="-1 -1 0 0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:FormulaBarFunctionEditor">
                    <Grid>
                        <RichTextBox x:Name="PART_TextBox"
                                FontWeight="{TemplateBinding FontWeight}"
                                FontStyle="{TemplateBinding FontStyle}"
                                VerticalScrollBarVisibility="Hidden"
                                Style="{StaticResource ResourceKey=FormulaBoxTextBoxStyle}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadSpreadsheetFormulaBarStyle" TargetType="spreadsheetControls:RadSpreadsheetFormulaBar">
        <Setter Property="Background" Value="{StaticResource FormulaBarBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource FormulaBarBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1 1 1 0"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:RadSpreadsheetFormulaBar">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Height="Auto" Background="{StaticResource FormulaBarFunctionInputOperatorBrush}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="22"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <spreadsheetControls:NameBox SheetEditor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.ActiveSheetEditor}" Width="162"/>
                            <Grid Margin="0 -1 0 0" VerticalAlignment="Center" Grid.Column="1">
                                <Rectangle Fill="{StaticResource FormulaBarBackgroundBrush}" Margin="0 1 2 0"/>
                                <Path
                                        HorizontalAlignment="Left"
                                        Height="23"
                                        VerticalAlignment="Center"
                                        Data="M68,0 L68,25 12,25 C5,25 0,19.5 0,12.5 0,6 5,0 12,0 z"
                                        Stretch="Fill"
                                        Width="90"
                                        Fill="{StaticResource FormulaBarFunctionInputOperatorBrush}"
                                        Stroke="{StaticResource FormulaBarBorderBrush}"/>
                                <Ellipse HorizontalAlignment="Left" Height="8" VerticalAlignment="Center" Width="8" Margin="5 0 0 0" Fill="{StaticResource FormulaBarEllipseBrush}"/>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                    <telerik:RadButton x:Name="CancelFormulaButton"
                                            IsTabStop="False"
                                            IsBackgroundVisible="False"
                                            Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CancelChangesCommand}"
                                            IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsFormulaBarButtonEnabled}"
                                            Focusable="False">
                                        <Image Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/16/cancelFormula.png" Width="16"/>
                                    </telerik:RadButton>
                                    <telerik:RadButton x:Name="EnterFormulaButton"
                                            IsTabStop="False"
                                            IsBackgroundVisible="False"
                                            Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ApplyChangesCommand}"
                                            IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsFormulaBarButtonEnabled}"
                                            Focusable="False">
                                        <Image Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/16/enterFormula.png" Width="16"/>
                                    </telerik:RadButton>
                                    <telerik:RadButton x:Name="InsertFunctionButton"
                                            IsBackgroundVisible="False"
                                            IsTabStop="False"
                                            IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.CommandDescriptors.ShowInsertFunctionDialog.IsEnabled}"
                                            Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.CommandDescriptors.ShowInsertFunctionDialog.Command}"
                                            Focusable="False">
                                        <Image Source="{telerik:IconResource IconRelativePath=16/insertFunction.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                    </telerik:RadButton>
                                </StackPanel>
                            </Grid>
                            <Border Grid.ColumnSpan="2" BorderBrush="{StaticResource FormulaBarBorderBrush}" BorderThickness="0 1 0 0" VerticalAlignment="Top" Margin="0 21 0 0"/>
                            <spreadsheetControls:FormulaBarFunctionEditor x:Name="FormulaBarFunctionEditor"
                                    IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsFormulaBarEnabled}"
                                    Grid.Column="2"
                                    Grid.RowSpan="2"
                                    Style="{StaticResource FormulaBoxStyle}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TrackPredefinedStyle" TargetType="ContentControl">
        <Setter Property="Height" Value="2"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <StackPanel>
                        <Border BorderThickness="1" BorderBrush="{StaticResource SliderDarkerBrush}" Height="1"/>
                        <Border BorderThickness="1" BorderBrush="{StaticResource SliderLighterBrush}" Height="1"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ThumbPredefinedStyle" TargetType="Thumb">
        <Setter Property="Width" Value="10"/>
        <Setter Property="Height" Value="14"/>
        <Setter Property="BorderBrush" Value="{StaticResource ZoomInOutButtonForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource ZoomInOutButtonBackgroundBrush}"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ZoomIndicator" Storyboard.TargetProperty="Fill" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlBackground_Highlighted}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ZoomIndicator" Storyboard.TargetProperty="Stroke" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlSubItem_OuterBorder_Selected}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ZoomIndicator" Storyboard.TargetProperty="Fill" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlSubItem_Background_Selected}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ZoomIndicator" Storyboard.TargetProperty="Stroke" Duration="0:0:0">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlOuterBorder_Focused}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path x:Name="ZoomIndicator"
                                Data="M0.0,0 L10.0,0 L10.0,10 L9.9,10 L5,17.9 L0.0,10 L0.0,10 L0.0,9.9 L0,9.9 L0.0,9.9 z"
                                Fill="{TemplateBinding Background}"
                                Stroke="{TemplateBinding BorderBrush}"
                                StrokeThickness="{TemplateBinding BorderThickness}"
                                Width="{TemplateBinding Width}"
                                Height="{TemplateBinding Height}"
                                Stretch="Fill"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ScaleFactorSliderStyle" TargetType="spreadsheetControls:ScaleFactorSlider">
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:ScaleFactorSlider">
                    <Grid HorizontalAlignment="Right" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <telerik:RadButton x:Name="PART_ShowCustomScaleDialogButton"
                                IsBackgroundVisible="False"
                                IsTabStop="False"
                                Grid.Column="0"
                                ContentStringFormat="{}{0}%"
                                Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ScaleFactor.Width, Converter={StaticResource doubleToPercentConverter}}"
                                Focusable="False"
                                Width="50"
                                CornerRadius="3"
                                Margin="0 1 5 1"/>
                        <telerik:RadButton x:Name="ScaleOutButton"
                                IsTabStop="False"
                                Grid.Column="1"
                                Width="16"
                                Height="16"
                                CornerRadius="15"
                                BorderBrush="{StaticResource ZoomInOutButtonBorderBrush}"
                                Background="{StaticResource ZoomInOutButtonBackgroundBrush}"
                                Focusable="False">
                            <Path Data="M461.1,217.7 L469.3,217.7" Stretch="Fill" Stroke="{StaticResource ZoomInOutButtonForegroundBrush}" StrokeThickness="2" Width="10" Height="2"/>
                        </telerik:RadButton>
                        <telerik:RadSlider
                                Grid.Column="2"
                                x:Name="PART_ScaleSlider"
                                Minimum="0"
                                Maximum="1"
                                VerticalAlignment="Center"
                                TrackStyle="{StaticResource TrackPredefinedStyle}"
                                ThumbStyle="{StaticResource ThumbPredefinedStyle}"/>
                        <telerik:RadButton
                                Grid.Column="3"
                                x:Name="ScaleInButton"
                                IsTabStop="False"
                                Width="16"
                                Height="16"
                                CornerRadius="15"
                                BorderBrush="{StaticResource ZoomInOutButtonBorderBrush}"
                                Background="{StaticResource ZoomInOutButtonBackgroundBrush}"
                                Focusable="False">
                            <Grid>
                                <Path Data="M374,105 L374,167.5" Stretch="Fill" StrokeThickness="2" Stroke="{StaticResource ZoomInOutButtonForegroundBrush}" Width="2" Height="10"/>
                                <Path Data="M461.1,217.7 L469.3,217.7" Stretch="Fill" Stroke="{StaticResource ZoomInOutButtonForegroundBrush}" StrokeThickness="2" Width="10" Height="2"/>
                            </Grid>
                        </telerik:RadButton>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadSpreadsheetStatusBarStyle" TargetType="spreadsheetControls:RadSpreadsheetStatusBar">
        <Setter Property="BorderBrush" Value="{StaticResource RadSpreadsheetStatusBar_BorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource RadSpreadsheetStatusBar_Background}"/>
        <Setter Property="Foreground" Value="{StaticResource RowColHeadingForegroundBrush}"/>
        <Setter Property="Margin" Value="{StaticResource StatusBarMarginThickness}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:RadSpreadsheetStatusBar">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Border BorderThickness="0 0 1 0" BorderBrush="{TemplateBinding BorderBrush}" Padding="5 0" VerticalAlignment="Center">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_StatusBar_Ready"/>
                            </Border>
                            <Border Grid.Column="2" Padding="5 0" BorderThickness="1 0 0 0" BorderBrush="{TemplateBinding BorderBrush}">
                                <spreadsheetControls:ScaleFactorSlider IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.CommandDescriptors.ScaleFactor.IsEnabled}" ScaleFactor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.ActiveSheetEditor.ScaleFactor, Mode=TwoWay}" ActiveSheetEditor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RadSpreadsheet.ActiveSheetEditor, Mode=OneWay}"/>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="StyleGalleryContentItemStyle" TargetType="ListBoxItem">
        <Setter Property="Padding" Value="4 3"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <telerik:RadContextMenu.ContextMenu>
                            <telerik:RadContextMenu x:Name="PART_ContextMenu">
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleGallery_Apply" Command="{Binding Path=ApplyStyleCommand, Mode=OneTime}" CommandParameter="{Binding Path=ContentItem, Mode=OneTime}"/>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleGallery_Modify" Command="{Binding Path=ModifyStyleCommand, Mode=OneTime}" CommandParameter="{Binding Path=ContentItem, Mode=OneTime}"/>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleGallery_Duplicate" Command="{Binding Path=DuplicateStyleCommand, Mode=OneTime}" CommandParameter="{Binding Path=ContentItem, Mode=OneTime}"/>
                                <telerik:RadMenuItem
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleGallery_Delete"
                                        Command="{Binding Path=DeleteStyleCommand, Mode=OneTime}"
                                        CommandParameter="{Binding Path=ContentItem, Mode=OneTime}"
                                        IsEnabled="{Binding Path=ContentItem.CellStyle.IsRemoveable, Mode=OneTime}"/>
                            </telerik:RadContextMenu>
                        </telerik:RadContextMenu.ContextMenu>
                        <ToolTipService.ToolTip>
                            <ToolTip Content="{Binding Path=ContentItem.CellStyle.Name, Mode=OneTime}"/>
                        </ToolTipService.ToolTip>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".50" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".75" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedRectangle"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="MouseOverVisualElement" BorderBrush="{StaticResource StyleGalleryItemBorderBrush}" BorderThickness="1" Opacity="0" CornerRadius="2">
                            <Rectangle Fill="{StaticResource StyleGalleryMouseOverItemBackgroundBrush}" Stroke="#FFFFFFFF" StrokeThickness="1" IsHitTestVisible="False" Opacity="1" RadiusY="2" RadiusX="2"/>
                        </Border>
                        <Rectangle x:Name="SelectedRectangle"
                                Fill="{StaticResource StyleGallerySelectedItemBackgroundBrush}"
                                Stroke="{StaticResource StyleGalleryItemBorderBrush}"
                                StrokeThickness="1"
                                IsHitTestVisible="False"
                                Opacity="0"
                                RadiusY="2"
                                RadiusX="2"/>
                        <Rectangle Fill="#FFFFFFFF" IsHitTestVisible="False" Margin="{TemplateBinding Padding}"/>
                        <Rectangle x:Name="FocusVisualElement" RadiusY="2" RadiusX="2" Stroke="{StaticResource StyleGalleryItemBorderBrush}" StrokeThickness="1" Visibility="Collapsed"/>
                        <Image x:Name="contentPresenter"
                                Source="{Binding Path=ContentItem.ImageSource}"
                                Stretch="None"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                Margin="{TemplateBinding Padding}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="StyleGalleryStyle" TargetType="spreadsheetControls:StyleGallery">
        <Setter Property="Margin" Value="0 1 0 2"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="PopupContentWidth" Value="636"/>
        <Setter Property="QuickStylesWidth" Value="443"/>
        <Setter Property="Foreground" Value="{StaticResource RowColHeadingForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="GalleryHeaderItemStyle" Value="{StaticResource StyleGalleryHeaderItemStyle}"/>
        <Setter Property="GalleryContentItemStyle" Value="{StaticResource StyleGalleryContentItemStyle}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:StyleGallery">
                    <Grid Width="{TemplateBinding QuickStylesWidth}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <ListBox x:Name="QuickStyles"
                                    ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                    ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                    IsTabStop="False"
                                    Background="{TemplateBinding Background}">
                                <ListBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <telerik:RadWrapPanel Orientation="Horizontal" MaxWidth="{Binding QuickStylesWidth}"/>
                                    </ItemsPanelTemplate>
                                </ListBox.ItemsPanel>
                            </ListBox>
                            <Grid Grid.Column="1" Margin="0" Width="15">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <telerik:RadButton x:Name="PageUpButton"
                                        IsTabStop="False"
                                        HorizontalAlignment="Stretch"
                                        Margin="-1 0 0 0"
                                        VerticalContentAlignment="Center"
                                        CornerRadius="0 1 0 0"
                                        Padding="0"
                                        MinHeight="22">
                                    <Path
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Fill="{StaticResource StyleGallery_ArrowButtonBrush}"
                                            Data="M 0,4 L4,0 L 8,4"
                                            Stroke="{StaticResource StyleGallery_ArrowButtonHighlight}"/>
                                </telerik:RadButton>
                                <telerik:RadButton x:Name="PageDownButton"
                                        MinHeight="22"
                                        CornerRadius="0 0 1 0"
                                        HorizontalAlignment="Stretch"
                                        Grid.Row="1"
                                        IsTabStop="False"
                                        VerticalContentAlignment="Center"
                                        Padding="0"
                                        Margin="-1 0 0 0">
                                    <Path
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Fill="{StaticResource StyleGallery_ArrowButtonBrush}"
                                            Data="M0,0 L8,0 4,4z"
                                            Stroke="{StaticResource StyleGallery_ArrowButtonHighlight}"/>
                                </telerik:RadButton>
                                <telerik:RadButton x:Name="PopupLaunchButton" Padding="0" HorizontalAlignment="Stretch" Margin="-1 0 0 0" VerticalContentAlignment="Center" IsTabStop="False" Grid.Row="2" MinHeight="20">
                                    <ToolTipService.ToolTip>
                                        <ToolTip
                                                Background="{StaticResource SpreadsheetToolTipBackgroundBrush}"
                                                BorderBrush="{StaticResource SpreadsheetToolTipBorderBrush}"
                                                Foreground="{StaticResource SpreadsheetToolTipForegroundBrush}"
                                                BorderThickness="1">
                                            <StackPanel>
                                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleGallery_More" FontWeight="Bold" FontSize="11"/>
                                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleGallery_ToolTipInfo" Margin="4" TextWrapping="Wrap" MaxWidth="200" FontSize="11"/>
                                            </StackPanel>
                                        </ToolTip>
                                    </ToolTipService.ToolTip>
                                    <Path
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Stretch="None"
                                            Fill="{StaticResource StyleGallery_ArrowButtonBrush}"
                                            Data="M0,0 L0,1 L6,1 L6,0 M0,2 L3,6 L6,2"
                                            Margin="0 2 0 0"
                                            Stroke="{StaticResource StyleGallery_ArrowButtonHighlight}"/>
                                </telerik:RadButton>
                            </Grid>
                        </Grid>
                        <telerik:RadDropDownButton x:Name="PopupContainer" Width="{Binding PopupContentWidth}" Height="0" MaxHeight="0" MinHeight="0" IsTabStop="False" Margin="-5 -71 0 0">
                            <telerik:RadDropDownButton.DropDownContent>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <ListBox x:Name="PopupListBox" ScrollViewer.VerticalScrollBarVisibility="Visible" BorderThickness="0" IsTabStop="False">
                                        <ListBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <telerik:RadWrapPanel Orientation="Horizontal" MaxWidth="{Binding PopupContentWidth}" Margin="-1"/>
                                            </ItemsPanelTemplate>
                                        </ListBox.ItemsPanel>
                                    </ListBox>
                                    <telerik:RadContextMenu Grid.Row="1" BorderThickness="0 1 0 0" Padding="0" BorderBrush="{Binding ElementName=PopupListBox, Path=BorderBrush}" IsTabStop="False">
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleDialog_NewCellStyle" x:Name="NewCellStyleMenuItem" IsTabStop="False">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/16/newCellStyle.png" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                        </telerik:RadMenuItem>
                                    </telerik:RadContextMenu>
                                </Grid>
                            </telerik:RadDropDownButton.DropDownContent>
                        </telerik:RadDropDownButton>
                        <telerikControls:RadSpreadsheet x:Name="SnapshotRadSpreadsheet" Width="500" Height="500" Canvas.ZIndex="3000" Margin="500 500 0 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="LargeThemePreviewControlStyle" TargetType="spreadsheetControls:LargeThemePreviewControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:LargeThemePreviewControl">
                    <Border Background="{StaticResource ThemeControlMainBackgroundBrush}" BorderBrush="{StaticResource ThemeControlMediumBrush}" BorderThickness="1">
                        <Grid Margin="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="4"/>
                                <ColumnDefinition Width="39"/>
                                <ColumnDefinition Width="7"/>
                                <ColumnDefinition Width="10"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="7"/>
                                <RowDefinition Height="39"/>
                            </Grid.RowDefinitions>
                            <Rectangle Fill="{Binding Path=Text2}" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
                            <Border BorderBrush="{StaticResource ThemeControlLowBrush}" Background="{StaticResource ThemeControlMainBackgroundBrush}" Grid.ColumnSpan="2" BorderThickness="1 1 1 0"/>
                            <Border BorderBrush="{StaticResource ThemeControlLowBrush}" Background="{StaticResource ThemeControlMainBackgroundBrush}" Grid.RowSpan="2" BorderThickness="1 1 0 1"/>
                            <Border
                                    BorderBrush="{StaticResource ThemeControlHighBrush}"
                                    Background="{StaticResource ThemeControlMainBackgroundBrush}"
                                    Grid.Column="1"
                                    Grid.Row="1"
                                    BorderThickness="0 0 0 1"/>
                            <Border
                                    BorderBrush="{StaticResource ThemeControlHighBrush}"
                                    Background="{StaticResource ThemeControlMainBackgroundBrush}"
                                    Grid.Column="2"
                                    Grid.Row="1"
                                    BorderThickness="0 1 1 1"/>
                            <TextBlock Grid.RowSpan="2" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 1 0 0" TextAlignment="Left">
                                <TextBlock.Inlines>
                                    <Run FontSize="{Binding Path=MajorFontSize}" FontFamily="{Binding Path=Major}" Foreground="{Binding Path=Text2}" Text="A"/>
                                    <Run FontSize="{Binding Path=MinorFontSize}" FontFamily="{Binding Path=Minor}" Foreground="{Binding Path=Text2}" Text="a"/>
                                </TextBlock.Inlines>
                            </TextBlock>
                            <Border
                                    BorderBrush="{StaticResource ThemeControlLightBrush}"
                                    Width="12"
                                    Height="2"
                                    BorderThickness="1"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Grid.ColumnSpan="2"
                                    HorizontalAlignment="Left"
                                    Margin="29 -3 0 0"/>
                            <Border
                                    BorderBrush="{StaticResource ThemeControlLightBrush}"
                                    Width="41"
                                    Height="2"
                                    BorderThickness="1"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Grid.ColumnSpan="2"
                                    HorizontalAlignment="Left"
                                    Margin="0 4 0 0"/>
                            <Border
                                    BorderBrush="{StaticResource ThemeControlLightBrush}"
                                    Width="41"
                                    Height="2"
                                    BorderThickness="1"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Grid.ColumnSpan="2"
                                    HorizontalAlignment="Left"
                                    Margin="0 13 0 0"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent1}"
                                    Width="6"
                                    Height="5"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="4 0 0 5"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent2}"
                                    Width="6"
                                    Height="5"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="11 0 0 5"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent3}"
                                    Width="6"
                                    Height="5"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="18 0 0 5"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent4}"
                                    Width="6"
                                    Height="5"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="25 0 0 5"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent5}"
                                    Width="6"
                                    Height="5"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="32 0 0 5"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent6}"
                                    Width="6"
                                    Height="5"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="39 0 0 5"/>
                            <Canvas Grid.Column="2">
                                <Path Fill="{StaticResource ThemeControlPathFillBrush}" Data="M 0 7 L 0 0 7 7 Z"/>
                            </Canvas>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DocumentThemeListBoxItemStyle" TargetType="telerik:RadListBoxItem">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="{StaticResource RowColHeadingForegroundBrush}"/>
        <Setter Property="Padding" Value="4 4 4 1"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadListBoxItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SelectedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SelectedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="LayoutStates"/>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Wrapper">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Wrapper">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Container"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates"/>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Container"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="2">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Border x:Name="SelectedVisual"
                                        Visibility="Collapsed"
                                        Grid.RowSpan="2"
                                        Margin="0"
                                        BorderThickness="1"
                                        BorderBrush="{StaticResource ControlSubItem_OuterBorder_Selected}"
                                        Background="{StaticResource ControlSubItem_Background_Selected}"
                                        CornerRadius="2"/>
                                <Border x:Name="Wrapper"
                                        Visibility="Collapsed"
                                        Grid.RowSpan="2"
                                        BorderBrush="{StaticResource ControlOuterBorder_Focused}"
                                        BorderThickness="1"
                                        Background="{StaticResource ControlBackground_Highlighted}"
                                        CornerRadius="2"/>
                                <spreadsheetControls:LargeThemePreviewControl
                                        Margin="{TemplateBinding Padding}"
                                        Accent1="{Binding ElementName=Container, Path=DataContext.Accent1}"
                                        Accent2="{Binding ElementName=Container, Path=DataContext.Accent2}"
                                        Accent3="{Binding ElementName=Container, Path=DataContext.Accent3}"
                                        Accent4="{Binding ElementName=Container, Path=DataContext.Accent4}"
                                        Accent5="{Binding ElementName=Container, Path=DataContext.Accent5}"
                                        Accent6="{Binding ElementName=Container, Path=DataContext.Accent6}"
                                        Text2="{Binding ElementName=Container, Path=DataContext.Text2}"
                                        Major="{Binding ElementName=Container, Path=DataContext.Major}"
                                        Minor="{Binding ElementName=Container, Path=DataContext.Minor}"/>
                                <TextBlock Text="{Binding Path=Name}" Grid.Row="1" HorizontalAlignment="Center" Margin="0 0 0 2"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ThemeGalleryStyle" TargetType="spreadsheetControls:ThemeGallery">
        <Setter Property="PopupContentWidth" Value="297"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Height" Value="382"/>
        <Setter Property="GalleryHeaderItemStyle" Value="{StaticResource GalleryHeaderItemStyle}"/>
        <Setter Property="GalleryContentItemStyle" Value="{StaticResource DocumentThemeListBoxItemStyle}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:ThemeGallery">
                    <Grid>
                        <telerik:RadListBox x:Name="PopupListBox" ScrollViewer.VerticalScrollBarVisibility="Visible" Padding="0" BorderThickness="0" Margin="-1">
                            <telerik:RadListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <telerik:RadWrapPanel Orientation="Horizontal" Width="{Binding PopupContentWidth}"/>
                                </ItemsPanelTemplate>
                            </telerik:RadListBox.ItemsPanel>
                        </telerik:RadListBox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SmallThemePreviewControlStyle" TargetType="spreadsheetControls:SmallThemePreviewControl">
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:SmallThemePreviewControl">
                    <Border Background="{StaticResource ThemeControlMainBackgroundBrush}" BorderBrush="{StaticResource ThemeControlMediumBrush}" BorderThickness="1">
                        <Grid Margin="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="4"/>
                                <ColumnDefinition Width="16"/>
                                <ColumnDefinition Width="7"/>
                                <ColumnDefinition Width="3"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="7"/>
                                <RowDefinition Height="21"/>
                            </Grid.RowDefinitions>
                            <Rectangle Fill="{Binding Path=Text2}" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
                            <Border BorderBrush="{StaticResource ThemeControlLowBrush}" Background="{StaticResource ThemeControlMainBackgroundBrush}" Grid.ColumnSpan="2" BorderThickness="1 1 1 0"/>
                            <Border BorderBrush="{StaticResource ThemeControlLowBrush}" Background="{StaticResource ThemeControlMainBackgroundBrush}" Grid.RowSpan="2" BorderThickness="1 1 0 1"/>
                            <Border
                                    BorderBrush="{StaticResource ThemeControlHighBrush}"
                                    Background="{StaticResource ThemeControlMainBackgroundBrush}"
                                    Grid.Column="1"
                                    Grid.Row="1"
                                    BorderThickness="0 0 0 1"/>
                            <Border
                                    BorderBrush="{StaticResource ThemeControlHighBrush}"
                                    Background="{StaticResource ThemeControlMainBackgroundBrush}"
                                    Grid.Column="2"
                                    Grid.Row="1"
                                    BorderThickness="0 1 1 1"/>
                            <TextBlock Grid.RowSpan="3" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="2 1 0 4" TextAlignment="Left">
                                <TextBlock.Inlines>
                                    <Run FontSize="{Binding Path=MajorFontSize}" FontFamily="{Binding Path=Major}" Foreground="{Binding Path=Text2}" Text="A"/>
                                    <Run FontSize="{Binding Path=MinorFontSize}" FontFamily="{Binding Path=Minor}" Foreground="{Binding Path=Text2}" Text="a"/>
                                </TextBlock.Inlines>
                            </TextBlock>
                            <Rectangle
                                    Fill="{Binding Path=Accent1}"
                                    Width="3"
                                    Height="3"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="2 0 0 3"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent2}"
                                    Width="3"
                                    Height="3"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="6 0 0 3"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent3}"
                                    Width="3"
                                    Height="3"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="10 0 0 3"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent4}"
                                    Width="3"
                                    Height="3"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="14 0 0 3"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent5}"
                                    Width="3"
                                    Height="3"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="18 0 0 3"/>
                            <Rectangle
                                    Fill="{Binding Path=Accent6}"
                                    Width="3"
                                    Height="3"
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Bottom"
                                    Margin="22 0 0 3"/>
                            <Canvas Grid.Column="2">
                                <Path Fill="{StaticResource ThemeControlPathFillBrush}" Data="M 0 7 L 0 0 7 7 Z"/>
                            </Canvas>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ThemeColorsListBoxItemStyle" TargetType="telerik:RadListBoxItem">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="{StaticResource RowColHeadingForegroundBrush}"/>
        <Setter Property="Padding" Value="5 2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadListBoxItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SelectedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SelectedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="LayoutStates"/>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Wrapper">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Wrapper">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates"/>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Container"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="2">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border x:Name="Wrapper"
                                        Visibility="Collapsed"
                                        Grid.ColumnSpan="2"
                                        BorderBrush="{StaticResource ControlOuterBorder_Focused}"
                                        BorderThickness="1"
                                        Background="{StaticResource ControlBackground_Highlighted}"
                                        CornerRadius="2"/>
                                <Border x:Name="SelectedVisual"
                                        Visibility="Collapsed"
                                        BorderThickness="1"
                                        BorderBrush="{StaticResource ControlSubItem_OuterBorder_Selected}"
                                        Background="{StaticResource ControlSubItem_Background_Selected}"
                                        CornerRadius="2"
                                        Margin="2"/>
                                <Grid Margin="{TemplateBinding Padding}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Text2}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Width="12" Height="12"/>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Background2}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Grid.Column="1" Width="12" Height="12"/>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Accent1}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Grid.Column="2" Width="12" Height="12"/>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Accent2}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Grid.Column="3" Width="12" Height="12"/>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Accent3}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Grid.Column="4" Width="12" Height="12"/>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Accent4}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Grid.Column="5" Width="12" Height="12"/>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Accent5}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Grid.Column="6" Width="12" Height="12"/>
                                    <Rectangle Margin="1 0" Fill="{Binding Path=Accent6}" StrokeThickness="1" Stroke="{StaticResource ThemeControlRectangleStrokeBrush}" Grid.Column="7" Width="12" Height="12"/>
                                </Grid>
                                <ContentPresenter x:Name="contentPresenter"
                                        Grid.Column="1"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        Content="{TemplateBinding Content}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        Margin="{TemplateBinding Padding}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ColorGalleryStyle" TargetType="spreadsheetControls:ColorGallery">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="PopupContentWidth" Value="205"/>
        <Setter Property="Height" Value="605"/>
        <Setter Property="GalleryHeaderItemStyle" Value="{StaticResource GalleryHeaderItemStyle}"/>
        <Setter Property="GalleryContentItemStyle" Value="{StaticResource ThemeColorsListBoxItemStyle}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:ColorGallery">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <telerik:RadListBox x:Name="PopupListBox" ScrollViewer.VerticalScrollBarVisibility="Visible" BorderThickness="0" Margin="-1" Padding="0">
                            <telerik:RadListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Width="{Binding PopupContentWidth}"/>
                                </ItemsPanelTemplate>
                            </telerik:RadListBox.ItemsPanel>
                        </telerik:RadListBox>
                        <telerik:RadContextMenu Grid.Row="1" BorderThickness="0 1 0 0" Padding="0">
                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_Themes_CreateNewThemeColors" Command="{Binding Path=RadSpreadsheet.CommandDescriptors.ShowCreateNewThemeColorsDialog.Command}"/>
                        </telerik:RadContextMenu>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SmallThemeColorPreviewControlStyle" TargetType="spreadsheetControls:SmallThemeColorPreviewControl">
        <Setter Property="Height" Value="16"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:SmallThemeColorPreviewControl">
                    <Border BorderBrush="{StaticResource ThemeControlMediumBrush}" BorderThickness="1">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Rectangle Fill="{Binding Path=Text2}"/>
                            <Rectangle Grid.Column="1" Fill="{Binding Path=Background2}"/>
                            <Rectangle Grid.Row="1" Fill="{Binding Path=Accent1}"/>
                            <Rectangle Grid.Row="1" Grid.Column="1" Fill="{Binding Path=Accent2}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ThemeFontListBoxItemStyle" TargetType="telerik:RadListBoxItem">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="{StaticResource RowColHeadingForegroundBrush}"/>
        <Setter Property="Padding" Value="20 2 0 2"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadListBoxItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SelectedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SelectedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="LayoutStates"/>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Wrapper">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Wrapper">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates"/>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Container"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="2">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border x:Name="SelectedVisual"
                                        Visibility="Collapsed"
                                        Grid.ColumnSpan="2"
                                        Margin="0"
                                        BorderThickness="1"
                                        BorderBrush="{StaticResource ControlSubItem_OuterBorder_Selected}"
                                        Background="{StaticResource ControlSubItem_Background_Selected}"
                                        CornerRadius="2"/>
                                <Border x:Name="Wrapper"
                                        Visibility="Collapsed"
                                        Grid.ColumnSpan="2"
                                        BorderBrush="{StaticResource ControlOuterBorder_Focused}"
                                        BorderThickness="1"
                                        Background="{StaticResource ControlBackground_Highlighted}"
                                        CornerRadius="2"/>
                                <Border Background="{StaticResource ThemeControlMediumBrush}" Padding="1" Width="43" Height="43" Margin="10 0 0 0">
                                    <Border Background="{StaticResource ThemeControlMainBackgroundBrush}" Padding="1">
                                        <Border Background="{StaticResource ThemeControlFontPreviewDarkBrush}" Padding="1">
                                            <Border Background="{StaticResource ThemeControlFontPreviewLightBrush}" Padding="1">
                                                <TextBlock Margin="2 0 0 0" VerticalAlignment="Bottom">
                                                    <TextBlock.Inlines>
                                                        <Run FontSize="21" FontFamily="{Binding Path=Major}" Text="A"/>
                                                        <Run FontSize="16" FontFamily="{Binding Path=Minor}" Text="a"/>
                                                    </TextBlock.Inlines>
                                                </TextBlock>
                                            </Border>
                                        </Border>
                                    </Border>
                                </Border>
                                <Grid Margin="{TemplateBinding Padding}" Grid.Column="1" Height="50">
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Text="{Binding Path=Name}" FontWeight="Bold" FontSize="10"/>
                                    <TextBlock Text="{Binding Path=Major}" FontFamily="{Binding Path=Major}" Grid.Row="1"/>
                                    <TextBlock Text="{Binding Path=Minor}" FontFamily="{Binding Path=Minor}" Grid.Row="2"/>
                                </Grid>
                                <ContentPresenter x:Name="contentPresenter"
                                        Grid.Column="1"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        Content="{TemplateBinding Content}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        Margin="{TemplateBinding Padding}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SmallThemeFontPreviewControlStyle" TargetType="spreadsheetControls:SmallThemeFontPreviewControl">
        <Setter Property="Background" Value="{StaticResource ThemeControlFontSmallPreviewRectangleGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ThemeControlFontSmallPreviewRectangleBorderBrush}"/>
        <Setter Property="Height" Value="16"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:SmallThemeFontPreviewControl">
                    <Grid>
                        <Rectangle Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}"/>
                        <TextBlock Text="A" FontFamily="{Binding Path=Major}" FontSize="15" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FontGalleryStyle" TargetType="spreadsheetControls:FontGallery">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Height" Value="586"/>
        <Setter Property="PopupContentWidth" Value="205"/>
        <Setter Property="GalleryHeaderItemStyle" Value="{StaticResource GalleryHeaderItemStyle}"/>
        <Setter Property="GalleryContentItemStyle" Value="{StaticResource ThemeFontListBoxItemStyle}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:FontGallery">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <telerik:RadListBox x:Name="PopupListBox" ScrollViewer.VerticalScrollBarVisibility="Visible" BorderThickness="0" Margin="-1" Padding="0">
                            <telerik:RadListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Width="{Binding PopupContentWidth}"/>
                                </ItemsPanelTemplate>
                            </telerik:RadListBox.ItemsPanel>
                        </telerik:RadListBox>
                        <telerik:RadContextMenu Grid.Row="1" BorderThickness="0 1 0 0" Padding="0">
                            <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_Themes_CreateNewThemeFonts" Command="{Binding Path=RadSpreadsheet.CommandDescriptors.ShowCreateNewThemeFontsDialog.Command}"/>
                        </telerik:RadContextMenu>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NumberFormatAutoCompleteComboBoxControlStyle" TargetType="spreadsheetControls:NumberFormatAutoCompleteComboBox">
        <Setter Property="Width" Value="140"/>
        <Setter Property="Height" Value="23"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:NumberFormatAutoCompleteComboBox">
                    <Grid Height="{TemplateBinding Height}" Margin="{TemplateBinding Padding}" Width="{TemplateBinding Width}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <telerik:RadAutoCompleteBox x:Name="autoCompleteBox"
                                SelectionMode="Single"
                                HorizontalAlignment="Stretch"
                                Padding="0"
                                TextSearchMode="StartsWith"
                                AutoCompleteMode="Append"
                                TextSearchPath="FormatTypeAsString"
                                SelectedItem="{Binding Path=CellValueFormat, Mode=TwoWay, Converter={StaticResource cellValueFormatToNumberFormatInfoConverter}}"
                                ItemsSource="{Binding NumberFormatSource}"/>
                        <telerik:RadDropDownButton x:Name="radDropDown"
                                Grid.Column="1"
                                Margin="-1 0 0 0"
                                IsOpen="{Binding Path=IsOpen, Mode=TwoWay}"
                                PopupPlacementTarget="{Binding ElementName=autoCompleteBox}"
                                Width="15"
                                MaxHeight="600">
                            <telerik:RadDropDownButton.DropDownContent>
                                <telerik:RadContextMenu BorderThickness="0">
                                    <telerik:RadMenuGroupItem Margin="-1">
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[0].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/general.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[0].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[0].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[1].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/number.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[1].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[1].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[2].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/currency.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[2].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[2].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[3].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/accounting.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[3].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[3].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[4].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/shortDate.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[4].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[4].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[5].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/longDate.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[5].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[5].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[6].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/time.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[6].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[6].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[7].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/percentage.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[7].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[7].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[8].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/fraction.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[8].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[8].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[9].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/scientific.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[9].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[9].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem IconColumnWidth="44" Command="{Binding RadSpreadsheet.CommandDescriptors.SetFormat.Command}" CommandParameter="{Binding NumberFormatSource[10].Format.FormatString}">
                                            <telerik:RadMenuItem.Icon>
                                                <Image Source="{telerik:IconResource IconRelativePath=32/textFormat.png, IconSources={StaticResource IconPaths}}" Stretch="None"/>
                                            </telerik:RadMenuItem.Icon>
                                            <telerik:RadMenuItem.Header>
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <TextBlock Text="{Binding Path=NumberFormatSource[10].FormatTypeAsString}" FontWeight="Bold"/>
                                                    <TextBlock Grid.Row="1" Text="{Binding Path=NumberFormatSource[10].FormatResult}" VerticalAlignment="Top" Margin="0 0 2 5"/>
                                                </Grid>
                                            </telerik:RadMenuItem.Header>
                                        </telerik:RadMenuItem>
                                    </telerik:RadMenuGroupItem>
                                    <telerik:RadMenuItem
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_NumberFormatComboBox_MoreFormats"
                                            CommandParameter="Number"
                                            spreadsheetControls:RadControlsExtensions.ShouldCloseParentPopupOnClick="True"
                                            Command="{Binding RadSpreadsheet.CommandDescriptors.ShowFormatCellsDialog.Command}"/>
                                </telerik:RadContextMenu>
                            </telerik:RadDropDownButton.DropDownContent>
                        </telerik:RadDropDownButton>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="LineStyle" TargetType="Line">
        <Setter Property="Margin" Value="10"/>
        <Setter Property="Stretch" Value="None"/>
        <Setter Property="X1" Value="0"/>
        <Setter Property="X2" Value="200"/>
        <Setter Property="Stroke" Value="{StaticResource LineStyleStrokeBrush}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
    </Style>
    <Style x:Key="BordersMenuStyle" TargetType="spreadsheetControls:BordersMenu">
        <Setter Property="IsEnabled" Value="{Binding Path=SetBorders.IsEnabled}"/>
        <Setter Property="SelectedItemCommand" Value="{Binding Path=SetBorders.Command}"/>
        <Setter Property="SelectedItemCommandParameter">
            <Setter.Value>
                <worksheetCommands:SetBordersCommandParameter BottomBorderStyle="Thin" BorderColor="Black"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:BordersMenu">
                    <telerik:RadSplitButton x:Name="BordersSplitButton"
                            BorderThickness="0"
                            IsToggle="False"
                            Background="Transparent"
                            Command="{Binding Path=SelectedItemCommand, RelativeSource={RelativeSource TemplatedParent}}"
                            CommandParameter="{Binding Path=SelectedItemCommandParameter, RelativeSource={RelativeSource TemplatedParent}}"
                            MinHeight="22">
                        <telerik:RadSplitButton.Content>
                            <Image Source="{Binding Path=SelectedItemImage, RelativeSource={RelativeSource TemplatedParent}}" Stretch="None" UseLayoutRounding="True"/>
                        </telerik:RadSplitButton.Content>
                        <telerik:RadSplitButton.DropDownContent>
                            <telerik:RadContextMenu BorderThickness="0" Padding="0" Margin="0" StaysOpen="False">
                                <telerik:RadMenuGroupItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_Borders" Background="Transparent" Padding="0" Margin="-1" BorderThickness="0">
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_BottomBorder" Command="{Binding Path=SetBorders.Command}">
                                        <telerik:RadMenuItem.CommandParameter>
                                            <worksheetCommands:SetBordersCommandParameter x:Name="BottomBorderCommandParameter" BottomBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}" BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{telerik:IconResource IconRelativePath=16/bottomBorder.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_TopBorder" Command="{Binding Path=SetBorders.Command}">
                                        <telerik:RadMenuItem.CommandParameter>
                                            <worksheetCommands:SetBordersCommandParameter x:Name="TopBorderCommandParameter" TopBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}" BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{telerik:IconResource IconRelativePath=16/topBorder.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_LeftBorder" Command="{Binding Path=SetBorders.Command}">
                                        <telerik:RadMenuItem.CommandParameter>
                                            <worksheetCommands:SetBordersCommandParameter x:Name="LeftBorderCommandParameter" LeftBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}" BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{telerik:IconResource IconRelativePath=16/leftBorder.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_RightBorder" Command="{Binding Path=SetBorders.Command}">
                                        <telerik:RadMenuItem.CommandParameter>
                                            <worksheetCommands:SetBordersCommandParameter x:Name="RightBorderCommandParameter" RightBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}" BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{telerik:IconResource IconRelativePath=16/rightBorder.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuGroupItem>
                                <telerik:RadMenuSeparatorItem/>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_NoBorder" Command="{Binding Path=SetBorders.Command}">
                                    <telerik:RadMenuItem.CommandParameter>
                                        <worksheetCommands:SetBordersCommandParameter x:Name="NoBorderCommandParameter" AllBordersStyle="None"/>
                                    </telerik:RadMenuItem.CommandParameter>
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/noBorders.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_AllBorder" Command="{Binding Path=SetBorders.Command}">
                                    <telerik:RadMenuItem.CommandParameter>
                                        <worksheetCommands:SetBordersCommandParameter x:Name="AllBorderCommandParameter"
                                                LeftBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                TopBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                RightBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                BottomBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                InsideHorizontalBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                InsideVerticalBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </telerik:RadMenuItem.CommandParameter>
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/allBorders.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_OutsideBorder" Command="{Binding Path=SetBorders.Command}">
                                    <telerik:RadMenuItem.CommandParameter>
                                        <worksheetCommands:SetBordersCommandParameter x:Name="OutsideBorderCommandParameter"
                                                LeftBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                TopBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                RightBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                BottomBorderStyle="{Binding Path=SelectedBorderStyle, RelativeSource={RelativeSource TemplatedParent}}"
                                                BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </telerik:RadMenuItem.CommandParameter>
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/outsideBorders.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_ThickBoxBorder" Command="{Binding Path=SetBorders.Command}">
                                    <telerik:RadMenuItem.CommandParameter>
                                        <worksheetCommands:SetBordersCommandParameter x:Name="ThickBoxBorderCommandParameter" OutsideBordersStyle="Thick" BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </telerik:RadMenuItem.CommandParameter>
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/thickBorderBox.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuSeparatorItem/>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_ThickBottomBorder" Command="{Binding Path=SetBorders.Command}">
                                    <telerik:RadMenuItem.CommandParameter>
                                        <worksheetCommands:SetBordersCommandParameter x:Name="ThickBottomBorderCommandParameter" BottomBorderStyle="Thick" BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </telerik:RadMenuItem.CommandParameter>
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/thickBottomBorder.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_TopAndBottomBorder" Command="{Binding Path=SetBorders.Command}">
                                    <telerik:RadMenuItem.CommandParameter>
                                        <worksheetCommands:SetBordersCommandParameter x:Name="TopBottomBorderCommandParameter"
                                                TopBorderStyle="Thin"
                                                BottomBorderStyle="Thin"
                                                BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </telerik:RadMenuItem.CommandParameter>
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/topAndBottomBorder.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_TopAndThickBottomBorder" Command="{Binding Path=SetBorders.Command}">
                                    <telerik:RadMenuItem.CommandParameter>
                                        <worksheetCommands:SetBordersCommandParameter x:Name="TopThickBottomBorderCommandParameter"
                                                TopBorderStyle="Thin"
                                                BottomBorderStyle="Thick"
                                                BorderColor="{Binding Path=SelectedBorderColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    </telerik:RadMenuItem.CommandParameter>
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/topAndThickBottomBorder.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuGroupItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_DrawBorders" BorderThickness="0" Background="Transparent" Margin="-1" Padding="0">
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_LineColor">
                                        <telerik:RadMenuItem.Icon>
                                            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                                <Image Source="{telerik:IconResource IconRelativePath=16/pen.png, IconSources={StaticResource IconPaths}}" Width="16" Height="16"/>
                                                <Rectangle x:Name="PenIconColorRectangle" Width="16" Height="3" Margin="0 -3 0 0"/>
                                            </StackPanel>
                                        </telerik:RadMenuItem.Icon>
                                        <telerik:RadMenuGroupItem BorderThickness="0" Padding="0">
                                            <telerik:RadColorSelector x:Name="BorderColorSelector"
                                                    MainPaletteHeaderText="{Binding Path=ColorSelectorMainPaletteHeaderText, RelativeSource={RelativeSource TemplatedParent}}"
                                                    StandardPaletteHeaderText="{Binding Path=ColorSelectorStandardPaletteHeaderText, RelativeSource={RelativeSource TemplatedParent}}"
                                                    Margin="-1"
                                                    BorderThickness="0"
                                                    AutomaticColor="Black"
                                                    HeaderPaletteItemsSource="{Binding Path=RadSpreadsheet.ColorPalette.HeaderPaletteItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
                                                    MainPaletteItemsSource="{Binding Path=RadSpreadsheet.ColorPalette.MainPaletteItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
                                                    MainPaletteOrientation="{Binding Path=RadSpreadsheet.ColorPalette.MainPaletteOrientation, RelativeSource={RelativeSource TemplatedParent}}"
                                                    RecentColorsVisibility="Visible"
                                                    IsRecentColorsActive="True">
                                                <telerik:EventToCommandBehavior.EventBindings>
                                                    <telerik:EventBinding
                                                            EventName="MouseLeftButtonUp"
                                                            CommandParameter="{Binding Path=SelectedColor,ElementName=BorderColorSelector}"
                                                            RaiseOnHandledEvents="True"
                                                            Command="{x:Static telerik:PopupCommands.CloseAll}"/>
                                                </telerik:EventToCommandBehavior.EventBindings>
                                                <telerik:RadColorSelector.AdditionalContent>
                                                    <telerik:RadButton x:Name="MoreColorsButton"
                                                            BorderThickness="0"
                                                            Margin="0 -1 0 0"
                                                            Background="Transparent"
                                                            HorizontalContentAlignment="Left"
                                                            IsEnabled="{Binding Path=ShowMoreColorsDialog.IsEnabled}"
                                                            Command="{Binding Path=ShowMoreColorsDialog.Command}"
                                                            CommandParameter="{Binding Path=UpdateSelectedBorderColorCommand, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}">
                                                        <StackPanel Orientation="Horizontal">
                                                            <Image Source="{telerik:IconResource IconRelativePath=16/color.png, IconSources={StaticResource IconPaths}}" Width="16" Height="16"/>
                                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_ColorSelector_MoreColors" Margin="10 0 0 0"/>
                                                        </StackPanel>
                                                    </telerik:RadButton>
                                                </telerik:RadColorSelector.AdditionalContent>
                                            </telerik:RadColorSelector>
                                        </telerik:RadMenuGroupItem>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_LineStyle">
                                        <telerik:RadMenuGroupItem BorderThickness="0" Padding="0" Margin="-1" Width="130">
                                            <telerik:RadListBox x:Name="BorderStyleSelector" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="329">
                                                <telerik:EventToCommandBehavior.EventBindings>
                                                    <telerik:EventBinding
                                                            EventName="MouseLeftButtonUp"
                                                            CommandParameter="{Binding Path=SelectedItem,ElementName=BorderStyleSelector}"
                                                            RaiseOnHandledEvents="True"
                                                            Command="{x:Static telerik:PopupCommands.CloseAll}"/>
                                                </telerik:EventToCommandBehavior.EventBindings>
                                                <telerik:RadListBox.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <VirtualizingStackPanel/>
                                                    </ItemsPanelTemplate>
                                                </telerik:RadListBox.ItemsPanel>
                                                <telerik:RadListBoxItem HorizontalContentAlignment="Left" Tag="None" Padding="0">
                                                    <TextBlock Margin="10 5" telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_NoBorder" Foreground="{StaticResource LineStyleStrokeBrush}"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="Thin" IsSelected="True">
                                                    <Line Style="{StaticResource LineStyle}" Height="1"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="Hair">
                                                    <Line Style="{StaticResource LineStyle}" Height="1" StrokeDashArray="1.5 1.5"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="Dotted">
                                                    <Line Style="{StaticResource LineStyle}" Height="1" StrokeDashArray="2 2"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="Dashed">
                                                    <Line Style="{StaticResource LineStyle}" Height="1" StrokeDashArray="3 1"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="DashDot">
                                                    <Line Style="{StaticResource LineStyle}" Height="1" StrokeDashArray="8 2 2 2"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="DashDotDot">
                                                    <Line Style="{StaticResource LineStyle}" Height="1" StrokeDashArray="8 2 2 2 2 2"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="Medium">
                                                    <Line Style="{StaticResource LineStyle}" StrokeThickness="2"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="MediumDashed">
                                                    <Line Style="{StaticResource LineStyle}" StrokeThickness="2" StrokeDashArray="2 1"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="MediumDashed">
                                                    <Line Style="{StaticResource LineStyle}" StrokeThickness="2" StrokeDashArray="4 1 1 1"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="MediumDashDotDot">
                                                    <Line Style="{StaticResource LineStyle}" StrokeThickness="2" StrokeDashArray="4 1 1 1 1 1"/>
                                                </telerik:RadListBoxItem>
                                                <telerik:RadListBoxItem Tag="Thick">
                                                    <Line Style="{StaticResource LineStyle}" StrokeThickness="3"/>
                                                </telerik:RadListBoxItem>
                                            </telerik:RadListBox>
                                        </telerik:RadMenuGroupItem>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuGroupItem>
                                <telerik:RadMenuSeparatorItem/>
                                <telerik:RadMenuItem
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_BorderMenu_MoreBorders"
                                        Command="{Binding Path=ShowFormatCellsDialog.Command}"
                                        IsEnabled="{Binding Path=ShowFormatCellsDialog.IsEnabled}"
                                        CommandParameter="Border">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/borders.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                            </telerik:RadContextMenu>
                        </telerik:RadSplitButton.DropDownContent>
                    </telerik:RadSplitButton>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="AdornerControlStyle" TargetType="spreadsheetControls:AdornerControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid x:Name="AdornerRoot">
                        <Grid x:Name="gridControl" RenderTransformOrigin="0.5,0.5" ShowGridLines="False" Background="Transparent">
                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsHorizontallyFlipped, Converter={StaticResource BoolToIntegerConverter}}" ScaleY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsVerticallyFlipped, Converter={StaticResource BoolToIntegerConverter}}"/>
                                    <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RotationAngle}"/>
                                </TransformGroup>
                            </Grid.RenderTransform>
                            <Grid.Resources>
                                <Style TargetType="Ellipse" x:Key="ResizeStyle">
                                    <Setter Property="Margin" Value="-5"/>
                                    <Setter Property="Width" Value="10"/>
                                    <Setter Property="Height" Value="10"/>
                                    <Setter Property="StrokeThickness" Value="1"/>
                                    <Setter Property="Stroke" Value="#4D7399"/>
                                    <Setter Property="Fill">
                                        <Setter.Value>
                                            <LinearGradientBrush StartPoint="0.5 0.2" EndPoint="0.5 0.8">
                                                <GradientStop Offset="0" Color="#FFFFFF"/>
                                                <GradientStop Offset="0.5" Color="#CAE9EC"/>
                                                <GradientStop Offset="1" Color="#FFFFFF"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                                <Style TargetType="Rectangle" x:Key="ResizeNoEdgeStyle">
                                    <Setter Property="Margin" Value="-4"/>
                                    <Setter Property="Width" Value="8"/>
                                    <Setter Property="Height" Value="8"/>
                                    <Setter Property="StrokeThickness" Value="1"/>
                                    <Setter Property="Stroke" Value="#4D7399"/>
                                    <Setter Property="Fill">
                                        <Setter.Value>
                                            <LinearGradientBrush StartPoint="0.5 0.2" EndPoint="0.5 0.8">
                                                <GradientStop Offset="0" Color="#FFFFFF"/>
                                                <GradientStop Offset="0.5" Color="#CAE9EC"/>
                                                <GradientStop Offset="1" Color="#FFFFFF"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                                <Style TargetType="Ellipse" x:Key="RotateStyle">
                                    <Setter Property="Margin" Value="-24"/>
                                    <Setter Property="Width" Value="10"/>
                                    <Setter Property="Height" Value="10"/>
                                    <Setter Property="StrokeThickness" Value="1"/>
                                    <Setter Property="Stroke" Value="#4D7399"/>
                                    <Setter Property="Fill">
                                        <Setter.Value>
                                            <LinearGradientBrush StartPoint="0.5 0.2" EndPoint="0.5 0.8">
                                                <GradientStop Offset="0" Color="#C4FF92"/>
                                                <GradientStop Offset="0.5" Color="#85E137"/>
                                                <GradientStop Offset="1" Color="#C4FF92"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Grid.Resources>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="0"/>
                                <RowDefinition/>
                                <RowDefinition Height="0"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="0"/>
                            </Grid.ColumnDefinitions>
                            <Image x:Name="ImagePreview" Stretch="Fill" Grid.Row="1" Grid.Column="1" Visibility="Collapsed" Opacity="1"/>
                            <Rectangle StrokeThickness="0" Width="1" Fill="#4D7399" Grid.RowSpan="3" HorizontalAlignment="Left" Grid.Column="1" VerticalAlignment="Stretch"/>
                            <Rectangle StrokeThickness="0" Width="1" Fill="#4D7399" Grid.RowSpan="3" HorizontalAlignment="Right" Grid.Column="1" VerticalAlignment="Stretch"/>
                            <Rectangle StrokeThickness="0" Height="1" Fill="#4D7399" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Grid.Row="1" VerticalAlignment="Top"/>
                            <Rectangle StrokeThickness="0" Height="1" Fill="#4D7399" Stroke="Black" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Grid.Row="1" VerticalAlignment="Bottom"/>
                            <Rectangle x:Name="rotateLine"
                                    StrokeThickness="0"
                                    Height="24"
                                    Width="1"
                                    Fill="#4D7399"
                                    Grid.ColumnSpan="3"
                                    HorizontalAlignment="Center"
                                    Grid.Row="1"
                                    VerticalAlignment="Top"
                                    Margin="0 -20 0 0"/>
                            <Ellipse x:Name="Rotate" Style="{StaticResource RotateStyle}" Stroke="#4D7399" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.ColumnSpan="3" Grid.RowSpan="3"/>
                            <Ellipse x:Name="Resize00" Style="{StaticResource ResizeStyle}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                            <Ellipse x:Name="Resize10" Style="{StaticResource ResizeStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top"/>
                            <Ellipse x:Name="Resize01" Style="{StaticResource ResizeStyle}" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
                            <Ellipse x:Name="Resize11" Style="{StaticResource ResizeStyle}" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
                            <Rectangle x:Name="ResizeTop" Style="{StaticResource ResizeNoEdgeStyle}" VerticalAlignment="Top" Grid.ColumnSpan="3" Grid.RowSpan="3"/>
                            <Rectangle x:Name="ResizeBottom" Style="{StaticResource ResizeNoEdgeStyle}" VerticalAlignment="Bottom" Grid.ColumnSpan="3" Grid.RowSpan="3"/>
                            <Rectangle x:Name="ResizeLeft" Style="{StaticResource ResizeNoEdgeStyle}" HorizontalAlignment="Left" Grid.ColumnSpan="3" Grid.RowSpan="3"/>
                            <Rectangle x:Name="ResizeRight" Style="{StaticResource ResizeNoEdgeStyle}" HorizontalAlignment="Right" Grid.ColumnSpan="3" Grid.RowSpan="3"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FunctionsMenuStyle" TargetType="spreadsheetControls:FunctionsMenu">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:FunctionsMenu">
                    <telerik:RadContextMenu BorderThickness="0" Padding="0">
                        <telerik:RadMenuGroupItem
                                Background="Transparent"
                                ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Items}"
                                DataContext="{Binding}"
                                IsEnabled="{Binding Path=ApplyFunction.IsEnabled}"
                                ScrollViewer.VerticalScrollBarVisibility="Auto"
                                MaxHeight="500"
                                StaysOpenOnClick="False"
                                MinWidth="120">
                            <telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                                <spreadsheetUtilities:SingleTemplateSelector>
                                    <spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                        <DataTemplate>
                                            <telerik:RadMenuItem
                                                    Header="{Binding Name}"
                                                    CommandParameter="{Binding Name}"
                                                    Command="{Binding Path=DataContext.ApplyFunction.Command, RelativeSource={RelativeSource AncestorType=spreadsheetControls:FunctionsMenu}}"
                                                    IsEnabled="{Binding Path=DataContext.ApplyFunction.IsEnabled, RelativeSource={RelativeSource AncestorType=spreadsheetControls:FunctionsMenu}}">
                                                <ToolTipService.ToolTip>
                                                    <ToolTip
                                                            Background="{StaticResource SpreadsheetToolTipBackgroundBrush}"
                                                            BorderBrush="{StaticResource SpreadsheetToolTipBorderBrush}"
                                                            Foreground="{StaticResource SpreadsheetToolTipForegroundBrush}"
                                                            BorderThickness="1">
                                                        <StackPanel>
                                                            <TextBlock Text="{Binding Name}" FontWeight="Bold" Margin="0 4 0 0" FontSize="11"/>
                                                            <TextBlock Text="{Binding Path=FunctionInfo.Description}" TextWrapping="Wrap" MaxWidth="200" Margin="4" FontSize="11"/>
                                                        </StackPanel>
                                                    </ToolTip>
                                                </ToolTipService.ToolTip>
                                            </telerik:RadMenuItem>
                                        </DataTemplate>
                                    </spreadsheetUtilities:SingleTemplateSelector.MenuItemTemplate>
                                </spreadsheetUtilities:SingleTemplateSelector>
                            </telerik:RadMenuGroupItem.ItemContainerTemplateSelector>
                        </telerik:RadMenuGroupItem>
                        <telerik:RadMenuItem
                                telerik:LocalizationManager.ResourceKey="Spreadsheet_FunctionsMenu_InsertFunction"
                                Command="{Binding Path=ShowInsertFunctionDialog.Command}"
                                IsEnabled="{Binding Path=ShowInsertFunctionDialog.IsEnabled}"
                                CommandParameter="{Binding Path=Category, RelativeSource={RelativeSource TemplatedParent}}">
                            <telerik:RadMenuItem.Icon>
                                <Image Source="{telerik:IconResource IconRelativePath=16/insertFunction.png, IconSources={StaticResource IconPaths}}" UseLayoutRounding="True" Stretch="None"/>
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>
                    </telerik:RadContextMenu>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FilteringPopupControlStyle" TargetType="spreadsheetControls:FilteringPopupControl">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <telerik:RadDropDownButton x:Name="PART_DropDownButton"
                            Command="{Binding InitializePopupCommand}"
                            IsOpen="{Binding Path=IsPopupOpened, Mode=TwoWay}"
                            IsEnabled="{Binding Path=CanFilter}"
                            IsTabStop="False"
                            Padding="0"
                            VerticalAlignment="Center"
                            Margin="0 -2 1 0"
                            DropDownIndicatorVisibility="Collapsed"
                            Focusable="False">
                        <telerik:RadDropDownButton.Content>
                            <StackPanel>
                                <Image
                                        Stretch="None"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Source="{telerik:IconResource IconRelativePath=16/filterArrow.png, IconSources={StaticResource IconPaths}}"
                                        Visibility="{Binding Path=FilterIsApplied, Converter={StaticResource BoolToVisibilityValueConverter}}"/>
                                <Image
                                        Stretch="None"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Source="{telerik:IconResource IconRelativePath=16/arrow.png, IconSources={StaticResource IconPaths}}"
                                        Visibility="{Binding Path=FilterIsApplied, Converter={StaticResource InversedBoolToVisibilityValueConverter}}"/>
                            </StackPanel>
                        </telerik:RadDropDownButton.Content>
                        <telerik:RadDropDownButton.DropDownContent>
                            <telerik:RadContextMenu DataContext="{Binding ElementName=PART_DropDownButton, Path=DataContext}" BorderThickness="0" Padding="0" Margin="0">
                                <telerik:RadMenuItem Command="{Binding ElementName=PART_DropDownButton, Path=DataContext.SortCommand}" CommandParameter="Ascending" telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_SortSmallestToLargest">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/sortAscending.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem Command="{Binding ElementName=PART_DropDownButton, Path=DataContext.SortCommand}" CommandParameter="Descending" telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_SortLargestToSmallest">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/sortDescending.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_SortByColor" DataContext="{Binding ElementName=PART_DropDownButton, Path=DataContext}">
                                    <telerik:RadMenuGroupItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_SortByCellColor" Visibility="{Binding Path=RangeContainsFillColors, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                        <telerik:RadListBox ItemsSource="{Binding Path=FillColorsItemsSource}" SelectedIndex="{Binding Path=SelectedSortFillColorIndex, Mode=TwoWay}" BorderThickness="0">
                                            <telerik:RadListBox.ItemTemplateSelector>
                                                <spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                        <DataTemplate>
                                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ColorSelectorNoFill" HorizontalAlignment="Center"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                        <DataTemplate>
                                                            <spreadsheetControls:PatternFillControl
                                                                    Width="50"
                                                                    Height="16"
                                                                    ColorScheme="{Binding ElementName=PART_DropDownButton, Path=DataContext.ColorScheme}"
                                                                    PatternType="{Binding Path=PatternType}"
                                                                    PatternColor="{Binding Path=., Converter={StaticResource PatternFillToPatternColorConverter}}"
                                                                    BackgroundColor="{Binding Path=., Converter={StaticResource PatternFillToBackgroundColorConverter}}"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.GradientFillTemplate>
                                                        <DataTemplate>
                                                            <spreadsheetControls:GradientFillControl
                                                                    MaxWidth="50"
                                                                    MaxHeight="16"
                                                                    ColorScheme="{Binding ElementName=PART_DropDownButton, Path=DataContext.ColorScheme}"
                                                                    GradientType="{Binding Path=GradientType}"
                                                                    Color1="{Binding Path=Color1}"
                                                                    Color2="{Binding Path=Color2}"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.GradientFillTemplate>
                                                </spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                            </telerik:RadListBox.ItemTemplateSelector>
                                        </telerik:RadListBox>
                                    </telerik:RadMenuGroupItem>
                                    <telerik:RadMenuGroupItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_SortByFontColor" Visibility="{Binding Path=RangeContainsFontColors, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                        <telerik:RadListBox ItemsSource="{Binding Path=ForeColorsItemsSource}" SelectedIndex="{Binding Path=SelectedSortForeColorIndex, Mode=TwoWay}" BorderThickness="0">
                                            <telerik:RadListBox.ItemTemplateSelector>
                                                <spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                        <DataTemplate>
                                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ColorSelectorAutomatic" HorizontalAlignment="Center"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                        <DataTemplate>
                                                            <spreadsheetControls:PatternFillControl
                                                                    Width="50"
                                                                    Height="16"
                                                                    ColorScheme="{Binding ElementName=PART_DropDownButton, Path=DataContext.ColorScheme}"
                                                                    PatternType="{Binding Path=PatternType}"
                                                                    PatternColor="{Binding Path=., Converter={StaticResource PatternFillToPatternColorConverter}}"
                                                                    BackgroundColor="{Binding Path=., Converter={StaticResource PatternFillToBackgroundColorConverter}}"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                </spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                            </telerik:RadListBox.ItemTemplateSelector>
                                        </telerik:RadListBox>
                                    </telerik:RadMenuGroupItem>
                                    <telerik:RadMenuItem Command="{Binding Path=SortCommand}" telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_CustomSort">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Source="{telerik:IconResource IconRelativePath=16/customSort.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuSeparatorItem/>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ClearFilter" DataContext="{Binding ElementName=PART_DropDownButton, Path=DataContext}" Command="{Binding Path=ClearFilter}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/filterClear.png, IconSources={StaticResource IconPaths}}" Width="16"/>
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_FilterByColor" DataContext="{Binding ElementName=PART_DropDownButton, Path=DataContext}" IsEnabled="{Binding Path=RangeContainsColors, Mode=TwoWay}">
                                    <telerik:RadMenuItem.IsChecked>
                                        <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                            <Binding.ConverterParameter>
                                                <spreadsheetControls:FilteringPopupConverterParameter IsColorFilter="True"/>
                                            </Binding.ConverterParameter>
                                        </Binding>
                                    </telerik:RadMenuItem.IsChecked>
                                    <telerik:RadMenuGroupItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_FilterByCellColor" Visibility="{Binding Path=RangeContainsFillColors, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                        <telerik:RadListBox
                                                ItemsSource="{Binding Path=FillColorsItemsSource}"
                                                SelectedIndex="{Binding Path=SelectedFilterFillColorIndex, Mode=TwoWay}"
                                                SelectedItem="{Binding Path=SelectedFilterFillColor, Mode=TwoWay}"
                                                BorderThickness="0">
                                            <telerik:RadListBox.ItemTemplateSelector>
                                                <spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                        <DataTemplate>
                                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ColorSelectorNoFill" HorizontalAlignment="Center"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                        <DataTemplate>
                                                            <spreadsheetControls:PatternFillControl
                                                                    Width="50"
                                                                    Height="16"
                                                                    ColorScheme="{Binding ElementName=PART_DropDownButton, Path=DataContext.ColorScheme}"
                                                                    PatternType="{Binding Path=PatternType}"
                                                                    PatternColor="{Binding Path=., Converter={StaticResource PatternFillToPatternColorConverter}}"
                                                                    BackgroundColor="{Binding Path=., Converter={StaticResource PatternFillToBackgroundColorConverter}}"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.GradientFillTemplate>
                                                        <DataTemplate>
                                                            <spreadsheetControls:GradientFillControl
                                                                    MaxWidth="50"
                                                                    MaxHeight="16"
                                                                    ColorScheme="{Binding ElementName=PART_DropDownButton, Path=DataContext.ColorScheme}"
                                                                    GradientType="{Binding Path=GradientType}"
                                                                    Color1="{Binding Path=Color1}"
                                                                    Color2="{Binding Path=Color2}"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.GradientFillTemplate>
                                                </spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                            </telerik:RadListBox.ItemTemplateSelector>
                                        </telerik:RadListBox>
                                    </telerik:RadMenuGroupItem>
                                    <telerik:RadMenuGroupItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_FilterByFontColor" Visibility="{Binding Path=RangeContainsFontColors, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                        <telerik:RadListBox
                                                ItemsSource="{Binding Path=ForeColorsItemsSource}"
                                                SelectedIndex="{Binding Path=SelectedFilterForeColorIndex, Mode=TwoWay}"
                                                SelectedItem="{Binding Path=SelectedFilterForeColor, Mode=TwoWay}"
                                                BorderThickness="0">
                                            <telerik:RadListBox.ItemTemplateSelector>
                                                <spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                        <DataTemplate>
                                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ColorSelectorAutomatic" HorizontalAlignment="Center"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                    <spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                        <DataTemplate>
                                                            <spreadsheetControls:PatternFillControl
                                                                    Width="50"
                                                                    Height="16"
                                                                    ColorScheme="{Binding ElementName=PART_DropDownButton, Path=DataContext.ColorScheme}"
                                                                    PatternType="{Binding Path=PatternType}"
                                                                    PatternColor="{Binding Path=., Converter={StaticResource PatternFillToPatternColorConverter}}"
                                                                    BackgroundColor="{Binding Path=., Converter={StaticResource PatternFillToBackgroundColorConverter}}"/>
                                                        </DataTemplate>
                                                    </spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                </spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                            </telerik:RadListBox.ItemTemplateSelector>
                                        </telerik:RadListBox>
                                    </telerik:RadMenuGroupItem>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_NumberFilters" DataContext="{Binding ElementName=PART_DropDownButton, Path=DataContext}" Visibility="{Binding Path=AreNumberFiltersVisible, Mode=TwoWay, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                    <telerik:RadMenuItem.IsChecked>
                                        <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                            <Binding.ConverterParameter>
                                                <spreadsheetControls:FilteringPopupConverterParameter IsNumberFilter="True"/>
                                            </Binding.ConverterParameter>
                                        </Binding>
                                    </telerik:RadMenuItem.IsChecked>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Equals" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="EqualsTo" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="EqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_DoesNotEqual" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="NotEqualsTo" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="NotEqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_GreaterThan" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="GreaterThan" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="GreaterThan" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_GreaterThanOrEqualTo" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="GreaterThanOrEqualsTo" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="GreaterThanOrEqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_LessThan" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="LessThan" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="LessThan" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_LessThanOrEqualTo" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="LessThanOrEqualsTo" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="LessThanOrEqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Between" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="GreaterThanOrEqualsTo" ComparisonOperator2="LessThanOrEqualsTo"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="GreaterThanOrEqualsTo" ComparisonOperator2="LessThanOrEqualsTo"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Top10" Command="{Binding Path=ShowTopFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter IsTopFilter="True"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_AboveAverage" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="AboveAverage">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="AboveAverage"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_BelowAverage" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="BelowAverage">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="BelowAverage"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_CustomFilter" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="EqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_DateFilters" DataContext="{Binding ElementName=PART_DropDownButton, Path=DataContext}" Visibility="{Binding Path=AreDateFiltersVisible, Mode=TwoWay, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                    <telerik:RadMenuItem.IsChecked>
                                        <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                            <Binding.ConverterParameter>
                                                <spreadsheetControls:FilteringPopupConverterParameter IsDateFilter="True"/>
                                            </Binding.ConverterParameter>
                                        </Binding>
                                    </telerik:RadMenuItem.IsChecked>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Tomorrow" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="Tomorrow">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="Tomorrow"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Today" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="Today">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="Today"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Yesterday" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="Yesterday">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="Yesterday"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_NextWeek" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="NextWeek">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="NextWeek"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ThisWeek" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="ThisWeek">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="ThisWeek"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_LastWeek" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="LastWeek">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="LastWeek"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_NextMonth" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="NextMonth">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="NextMonth"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ThisMonth" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="ThisMonth">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="ThisMonth"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_LastMonth" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="LastMonth">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="LastMonth"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_NextQuarter" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="NextQuarter">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="NextQuarter"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ThisQuarter" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="ThisQuarter">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="ThisQuarter"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_LastQuarter" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="LastQuarter">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="LastQuarter"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_NextYear" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="NextYear">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="NextYear"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_ThisYear" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="ThisYear">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="ThisYear"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_LastYear" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="LastYear">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="LastYear"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_YearToDate" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="YearToDate">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="YearToDate"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_AllDatesInThePeriod">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter IsAllDatesInThePeriod="True"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Quarter1" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="Quarter1">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="Quarter1"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Quarter2" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="Quarter2">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="Quarter2"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Quarter3" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="Quarter3">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="Quarter3"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Quarter4" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="Quarter4">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="Quarter4"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuSeparatorItem/>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_January" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="January">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="January"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_February" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="February">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="February"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_March" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="March">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="March"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_April" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="April">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="April"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_May" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="May">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="May"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_June" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="June">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="June"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_July" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="July">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="July"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_August" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="August">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="August"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_September" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="September">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="September"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_October" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="October">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="October"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_November" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="November">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="November"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_December" Command="{Binding Path=ApplyDynamicFilter}" CommandParameter="December">
                                            <telerik:RadMenuItem.IsChecked>
                                                <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                    <Binding.ConverterParameter>
                                                        <spreadsheetControls:FilteringPopupConverterParameter DynamicFilterType="December"/>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </telerik:RadMenuItem.IsChecked>
                                        </telerik:RadMenuItem>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_CustomFilter" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="EqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_TextFilters" DataContext="{Binding ElementName=PART_DropDownButton, Path=DataContext}" Visibility="{Binding Path=AreTextFiltersVisible, Mode=TwoWay, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                    <telerik:RadMenuItem.IsChecked>
                                        <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                            <Binding.ConverterParameter>
                                                <spreadsheetControls:FilteringPopupConverterParameter IsTextFilter="True"/>
                                            </Binding.ConverterParameter>
                                        </Binding>
                                    </telerik:RadMenuItem.IsChecked>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Equals" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="EqualsTo" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="EqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_DoesNotEqual" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.IsChecked>
                                            <Binding Path="Filter" Converter="{StaticResource FilterToVisibilityConverter}">
                                                <Binding.ConverterParameter>
                                                    <spreadsheetControls:FilteringPopupConverterParameter ComparisonOperator1="NotEqualsTo" ComparisonOperator2="None"/>
                                                </Binding.ConverterParameter>
                                            </Binding>
                                        </telerik:RadMenuItem.IsChecked>
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="NotEqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuSeparatorItem/>
                                    <telerik:RadMenuItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_CustomFilter" Command="{Binding Path=ShowCustomFilterDialog}">
                                        <telerik:RadMenuItem.CommandParameter>
                                            <spreadsheetControls:CustomFilterDialogCommandParameter ComparisonOperator1="EqualsTo" ComparisonOperator2="None"/>
                                        </telerik:RadMenuItem.CommandParameter>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuGroupItem BorderThickness="0" Focusable="False">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="27"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Border
                                                Background="{StaticResource FilteringPopupMenuIconsBackground}"
                                                BorderBrush="{StaticResource FilteringPopupMenuIconsSeparatorLeft}"
                                                BorderThickness="0 0 1 0"
                                                Grid.RowSpan="4"/>
                                        <telerik:RadTreeView
                                                Grid.Row="0"
                                                Grid.Column="1"
                                                IsLineEnabled="True"
                                                MinWidth="230"
                                                Height="250"
                                                BorderBrush="{StaticResource FilteringPopupMenuTreeViewBrush}"
                                                BorderThickness="1"
                                                Margin="4 8 8 0"
                                                DataContext="{Binding Path=FilteringPopupTreeViewViewModel}"
                                                ItemsSource="{Binding Path=Items}"
                                                IsVirtualizing="True">
                                            <telerik:RadTreeView.ItemTemplate>
                                                <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}"/>
                                                        <TextBlock Margin="5 0 0 0" Text="{Binding Name}" VerticalAlignment="Center"/>
                                                    </StackPanel>
                                                </HierarchicalDataTemplate>
                                            </telerik:RadTreeView.ItemTemplate>
                                        </telerik:RadTreeView>
                                        <StackPanel
                                                Grid.Column="1"
                                                Grid.Row="1"
                                                Orientation="Horizontal"
                                                Margin="4 5"
                                                Visibility="{Binding Path=FilteringPopupTreeViewViewModel.TreeIsOversize, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                            <Image Width="16" Height="16" Source="{telerik:IconResource IconRelativePath=16/warning.png, IconSources={StaticResource IconPaths}}"/>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FilteringPopup_Oversize" Margin="2 0"/>
                                        </StackPanel>
                                        <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 10 10 5">
                                            <telerik:RadButton
                                                    MinWidth="75"
                                                    Height="23"
                                                    Margin="0 0 10 0"
                                                    HorizontalAlignment="Left"
                                                    telerik:LocalizationManager.ResourceKey="Ok"
                                                    Command="{Binding Path=OkCommand}"
                                                    IsEnabled="{Binding Path=IsOkEnabled}"/>
                                            <telerik:RadButton Grid.Column="1" MinWidth="75" Height="23" HorizontalAlignment="Right" telerik:LocalizationManager.ResourceKey="Cancel" Command="{Binding Path=CloseCommand}"/>
                                        </StackPanel>
                                    </Grid>
                                </telerik:RadMenuGroupItem>
                            </telerik:RadContextMenu>
                        </telerik:RadDropDownButton.DropDownContent>
                    </telerik:RadDropDownButton>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DataValidationInputMessageControlStyle" TargetType="spreadsheetControls:DataValidationInputMessageControl">
        <Setter Property="AutomationProperties.AutomationId" Value="DataValidationInputMessageControl"/>
        <Setter Property="MaxWidth" Value="260"/>
        <Setter Property="MaxHeight" Value="160"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="spreadsheetControls:DataValidationInputMessageControl">
                    <Grid>
                        <Rectangle Fill="#FFFFFFE1" Stroke="#FF646464" StrokeThickness="1"/>
                        <StackPanel Margin="6">
                            <TextBlock Text="{Binding Path=InputMessageTitle}" TextWrapping="Wrap" FontWeight="Bold" AutomationProperties.AutomationId="inputMessageTitle"/>
                            <TextBlock Margin="2 0 0 0" FontWeight="Light" Text="{Binding Path=InputMessageContent}" TextWrapping="Wrap" AutomationProperties.AutomationId="inputMessageContent"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikControls:RadSpreadsheet" BasedOn="{StaticResource RadSpreadsheetStyle}"/>
    <Style TargetType="worksheet:NormalWorksheetEditorPresenter" BasedOn="{StaticResource NormalWorksheetEditorPresenterStyle}"/>
    <Style TargetType="worksheet:WorksheetPrintPresenter" BasedOn="{StaticResource WorksheetPrintPresenterStyle}"/>
    <Style TargetType="worksheetMargins:SelectAllControl" BasedOn="{StaticResource SelectAllControlStyle}"/>
    <Style TargetType="worksheet:RadWorksheetEditor" BasedOn="{StaticResource RadWorksheetEditorStyle}"/>
    <Style TargetType="worksheetMargins:ResizeThumb" BasedOn="{StaticResource ResizeThumbStyle}"/>
    <Style TargetType="worksheetMargins:UnhideThumb" BasedOn="{StaticResource UnhideThumbStyle}"/>
    <Style TargetType="worksheetMargins:RowHeading" BasedOn="{StaticResource RowHeadingStyle}"/>
    <Style TargetType="worksheetMargins:ColumnHeading" BasedOn="{StaticResource ColumnHeadingStyle}"/>
    <Style TargetType="worksheetMargins:PrintRowHeading" BasedOn="{StaticResource PrintRowHeadingStyle}"/>
    <Style TargetType="worksheetMargins:PrintColumnHeading" BasedOn="{StaticResource PrintColumnHeadingStyle}"/>
    <Style TargetType="worksheet:CellEditor" BasedOn="{StaticResource CellEditorStyle}"/>
    <Style TargetType="spreadsheetControls:PatternFillControl" BasedOn="{StaticResource PatternFillControlStyle}"/>
    <Style TargetType="spreadsheetControls:GradientFillControl" BasedOn="{StaticResource GradientFillControlStyle}"/>
    <Style TargetType="spreadsheetControls:SheetSelectorTabItem" BasedOn="{StaticResource SheetSelectorTabItemStyle}"/>
    <Style TargetType="spreadsheetControls:RadSpreadsheetSheetSelector" BasedOn="{StaticResource RadSpreadsheetSheetSelectorStyle}"/>
    <Style TargetType="spreadsheetControls:PrintPreviewControl" BasedOn="{StaticResource PrintPreviewControlStyle}"/>
    <Style TargetType="spreadsheetControls:NameBox" BasedOn="{StaticResource NameBoxStyle}"/>
    <Style TargetType="spreadsheetControls:RadSpreadsheetFormulaBar" BasedOn="{StaticResource RadSpreadsheetFormulaBarStyle}"/>
    <Style TargetType="spreadsheetControls:ScaleFactorSlider" BasedOn="{StaticResource ScaleFactorSliderStyle}"/>
    <Style TargetType="spreadsheetControls:RadSpreadsheetStatusBar" BasedOn="{StaticResource RadSpreadsheetStatusBarStyle}"/>
    <Style TargetType="spreadsheetControls:SpreadsheetGridSplitter" BasedOn="{StaticResource SpreadsheetGridSplitterStyle}"/>
    <Style TargetType="spreadsheetControls:StyleGallery" BasedOn="{StaticResource StyleGalleryStyle}"/>
    <Style TargetType="spreadsheetControls:ThemeGallery" BasedOn="{StaticResource ThemeGalleryStyle}"/>
    <Style TargetType="spreadsheetControls:LargeThemePreviewControl" BasedOn="{StaticResource LargeThemePreviewControlStyle}"/>
    <Style TargetType="spreadsheetControls:SmallThemePreviewControl" BasedOn="{StaticResource SmallThemePreviewControlStyle}"/>
    <Style TargetType="spreadsheetControls:ColorGallery" BasedOn="{StaticResource ColorGalleryStyle}"/>
    <Style TargetType="spreadsheetControls:SmallThemeColorPreviewControl" BasedOn="{StaticResource SmallThemeColorPreviewControlStyle}"/>
    <Style TargetType="spreadsheetControls:FontGallery" BasedOn="{StaticResource FontGalleryStyle}"/>
    <Style TargetType="spreadsheetControls:SmallThemeFontPreviewControl" BasedOn="{StaticResource SmallThemeFontPreviewControlStyle}"/>
    <Style TargetType="spreadsheetControls:NumberFormatAutoCompleteComboBox" BasedOn="{StaticResource NumberFormatAutoCompleteComboBoxControlStyle}"/>
    <Style TargetType="spreadsheetControls:BordersMenu" BasedOn="{StaticResource BordersMenuStyle}"/>
    <Style TargetType="spreadsheetControls:FunctionsMenu" BasedOn="{StaticResource FunctionsMenuStyle}"/>
    <Style TargetType="spreadsheetControls:AdornerControl" BasedOn="{StaticResource AdornerControlStyle}"/>
    <Style TargetType="spreadsheetControls:FilteringPopupControl" BasedOn="{StaticResource FilteringPopupControlStyle}"/>
    <Style TargetType="spreadsheetControls:DataValidationInputMessageControl" BasedOn="{StaticResource DataValidationInputMessageControlStyle}"/>
    <Style x:Key="FillEffectsDialogContentStyle" TargetType="dialogs:FillEffectsDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_FillEffectsDialog_Header"/>
        <Setter Property="MinWidth" Value="527"/>
        <Setter Property="MinHeight" Value="490"/>
        <Setter Property="WindowStartupLocation" Value="CenterScreen"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FillEffectsDialogContent">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="205*"/>
                            <RowDefinition Height="40"/>
                        </Grid.RowDefinitions>
                        <telerik:RadTabControl Margin="-1 0">
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_GradientTab" MinWidth="55">
                                <Grid Margin="5">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <telerik:GroupBox Margin="5" telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_Colors" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.ColumnSpan="2">
                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Left">
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_Color1" Margin="5 0 0 0"/>
                                            <spreadsheetControls:ColorSelectorDropDown
                                                    SelectedColor="{Binding Path=Color1, Mode=TwoWay}"
                                                    HeaderPaletteItemsSource="{Binding Path=ColorPalette.HeaderPaletteItemsSource}"
                                                    MainPaletteItemsSource="{Binding Path=ColorPalette.MainPaletteItemsSource}"
                                                    MainPaletteOrientation="{Binding Path=ColorPalette.MainPaletteOrientation}"
                                                    Margin="5 0 0 0"
                                                    x:Name="Color1Selector"
                                                    Height="22"
                                                    Width="120"/>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_Color2" Margin="5 5 0 0"/>
                                            <spreadsheetControls:ColorSelectorDropDown
                                                    SelectedColor="{Binding Path=Color2, Mode=TwoWay}"
                                                    HeaderPaletteItemsSource="{Binding Path=ColorPalette.HeaderPaletteItemsSource}"
                                                    MainPaletteItemsSource="{Binding Path=ColorPalette.MainPaletteItemsSource}"
                                                    MainPaletteOrientation="{Binding Path=ColorPalette.MainPaletteOrientation}"
                                                    Margin="5 0 0 0"
                                                    x:Name="Color2Selector"
                                                    Height="22"
                                                    Width="120"/>
                                        </StackPanel>
                                    </telerik:GroupBox>
                                    <StackPanel Margin="0 0 0 44" VerticalAlignment="Bottom" Orientation="Horizontal">
                                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_ShadingStyles" Height="140" Margin="5 0 13 0">
                                            <StackPanel Orientation="Vertical">
                                                <RadioButton x:Name="HorizontalGradient"
                                                        GroupName="1"
                                                        IsChecked="{Binding Path=SelectedShadingStyle, Mode=TwoWay, Converter={StaticResource ShadingStyleToBooleanConverter}, ConverterParameter=Horizontal}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_Horizontal"
                                                        Margin="0 0 0 2"/>
                                                <RadioButton x:Name="VerticalGradient"
                                                        GroupName="2"
                                                        IsChecked="{Binding Path=SelectedShadingStyle, Mode=TwoWay, Converter={StaticResource ShadingStyleToBooleanConverter}, ConverterParameter=Vertical}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_Vertical"
                                                        Margin="0 0 0 2"/>
                                                <RadioButton x:Name="DiagonalUpGradient"
                                                        GroupName="3"
                                                        IsChecked="{Binding Path=SelectedShadingStyle, Mode=TwoWay, Converter={StaticResource ShadingStyleToBooleanConverter}, ConverterParameter=DiagonalUp}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_DiagonalUp"
                                                        Margin="0 0 0 2"/>
                                                <RadioButton x:Name="DiagonalDownGradient"
                                                        GroupName="4"
                                                        IsChecked="{Binding Path=SelectedShadingStyle, Mode=TwoWay, Converter={StaticResource ShadingStyleToBooleanConverter}, ConverterParameter=DiagonalDown}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_DiagonalDown"
                                                        Margin="0 0 0 2"/>
                                                <RadioButton x:Name="FromCornerGradient"
                                                        GroupName="5"
                                                        IsChecked="{Binding Path=SelectedShadingStyle, Mode=TwoWay, Converter={StaticResource ShadingStyleToBooleanConverter}, ConverterParameter=FromCorner}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_FromCorner"
                                                        Margin="0 0 0 2"/>
                                                <RadioButton x:Name="FromCenterGradient"
                                                        GroupName="6"
                                                        IsChecked="{Binding Path=SelectedShadingStyle, Mode=TwoWay, Converter={StaticResource ShadingStyleToBooleanConverter}, ConverterParameter=FromCenter}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_FromCenter"/>
                                            </StackPanel>
                                        </telerik:GroupBox>
                                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_Variants" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="140" Margin="5">
                                            <telerik:RadListBox
                                                    Width="120"
                                                    HorizontalAlignment="Center"
                                                    VerticalAlignment="Stretch"
                                                    ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                                    ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                                    SelectedIndex="{Binding Path=SelectedGradientTypeIndex, Mode=TwoWay}"
                                                    ItemsSource="{Binding Path=GradientTypes}"
                                                    x:Name="ListBoxGradients"
                                                    BorderThickness="0">
                                                <telerik:RadListBox.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <telerik:RadWrapPanel
                                                                Orientation="Horizontal"
                                                                VerticalAlignment="Top"
                                                                Height="{Binding (FrameworkElement.ActualHeight), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                                                                Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"/>
                                                    </ItemsPanelTemplate>
                                                </telerik:RadListBox.ItemsPanel>
                                                <telerik:RadListBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <Border Grid.Column="1" Grid.Row="0" BorderBrush="Black" BorderThickness="1" Width="51" Height="51">
                                                            <spreadsheetControls:GradientFillControl
                                                                    ColorScheme="{Binding Path=DataContext.ColorPalette.ColorScheme, ElementName=ListBoxGradients}"
                                                                    GradientType="{Binding}"
                                                                    Color1="{Binding Path=DataContext.Color1, ElementName=ListBoxGradients, Converter={StaticResource ColorToThemableColorConverter}}"
                                                                    Color2="{Binding Path=DataContext.Color2, ElementName=ListBoxGradients, Converter={StaticResource ColorToThemableColorConverter}}"
                                                                    Width="51"
                                                                    Height="51"/>
                                                        </Border>
                                                    </DataTemplate>
                                                </telerik:RadListBox.ItemTemplate>
                                            </telerik:RadListBox>
                                        </telerik:GroupBox>
                                    </StackPanel>
                                    <StackPanel Grid.Column="1" VerticalAlignment="Bottom" Margin="0 0 0 12">
                                        <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FillEffectsDialog_Sample"/>
                                        <Border BorderBrush="Black" BorderThickness="1" Width="70" Height="70">
                                            <spreadsheetControls:GradientFillControl
                                                    ColorScheme="{Binding Path=ColorPalette.ColorScheme}"
                                                    GradientType="{Binding Path=GradientType}"
                                                    Color1="{Binding Path=DataContext.Color1, Converter={StaticResource ColorToThemableColorConverter}}"
                                                    Color2="{Binding Path=DataContext.Color2, Converter={StaticResource ColorToThemableColorConverter}}"
                                                    Width="70"
                                                    Height="70"/>
                                        </Border>
                                    </StackPanel>
                                </Grid>
                            </telerik:RadTabItem>
                        </telerik:RadTabControl>
                        <StackPanel Grid.Row="1" Orientation="Horizontal">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOK"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonCancel"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="GeneralCategoryContentStyle" TargetType="dialogs:GeneralCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:GeneralCategoryContent">
                    <StackPanel>
                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                            <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                        </telerik:GroupBox>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_GeneralInfo" Margin="0 5" TextWrapping="Wrap"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NumberCategoryContentStyle" TargetType="dialogs:NumberCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:NumberCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                                <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                            </telerik:GroupBox>
                            <StackPanel Orientation="Horizontal" Margin="0 5 5 0">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_DecimalPlaces" VerticalAlignment="Center"/>
                                <telerik:RadNumericUpDown VerticalAlignment="Top" Minimum="0" Value="{Binding DecimalPlaces, Mode=TwoWay}" IsInteger="True" Width="60" Margin="3 0 0 0"/>
                            </StackPanel>
                            <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_UseSeparator" IsChecked="{Binding UseThousandSeparator, Mode=TwoWay}" Margin="0 10 5 9"/>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_NegativeNumbers"/>
                        </StackPanel>
                        <telerik:RadListBox
                                Grid.Row="1"
                                SelectedValue="{Binding SelectedNumberItem, Mode=TwoWay}"
                                ItemsSource="{Binding NumberItems}"
                                ScrollViewer.VerticalScrollBarVisibility="Visible"
                                Height="150"
                                Margin="0 2 0 -3"
                                BorderThickness="1">
                            <telerik:RadListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Text}" Foreground="{Binding Foreground}"/>
                                </DataTemplate>
                            </telerik:RadListBox.ItemTemplate>
                        </telerik:RadListBox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CurrencyCategoryContentStyle" TargetType="dialogs:CurrencyCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CurrencyCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                                <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                            </telerik:GroupBox>
                            <StackPanel Orientation="Horizontal" Margin="0 5 5 0">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_DecimalPlaces" VerticalAlignment="Center"/>
                                <telerik:RadNumericUpDown Minimum="0" Value="{Binding DecimalPlaces, Mode=TwoWay}" VerticalAlignment="Top" IsInteger="True" Width="60" Margin="3 0 0 0"/>
                            </StackPanel>
                            <Grid Margin="0 7 0 5">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Symbol" Margin="0 5"/>
                                <telerik:RadComboBox Grid.Column="1" SelectedValue="{Binding SelectedCurrencyInfo, Mode=TwoWay}" ItemsSource="{Binding CurrencyInfos}" VerticalAlignment="Top" Margin="3 0 0 0">
                                    <telerik:RadComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding CurrencySymbol}" Width="37"/>
                                                <TextBlock Text="{Binding Culture.DisplayName}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </telerik:RadComboBox.ItemTemplate>
                                </telerik:RadComboBox>
                            </Grid>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_NegativeNumbers"/>
                        </StackPanel>
                        <telerik:RadListBox
                                Grid.Row="1"
                                ItemsSource="{Binding NumberItems}"
                                SelectedValue="{Binding SelectedNumberItem, Mode=TwoWay}"
                                ScrollViewer.VerticalScrollBarVisibility="Visible"
                                Height="149"
                                Margin="0 2 0 -3"
                                BorderThickness="1">
                            <telerik:RadListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Text}" Foreground="{Binding Foreground}"/>
                                </DataTemplate>
                            </telerik:RadListBox.ItemTemplate>
                        </telerik:RadListBox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="AccountingCategoryContentStyle" TargetType="dialogs:AccountingCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:AccountingCategoryContent">
                    <StackPanel>
                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                            <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                        </telerik:GroupBox>
                        <StackPanel Orientation="Horizontal" Margin="0 5 5 0">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_DecimalPlaces" VerticalAlignment="Center"/>
                            <telerik:RadNumericUpDown Minimum="0" Value="{Binding DecimalPlaces, Mode=TwoWay}" VerticalAlignment="Top" IsInteger="True" Width="60" Margin="3 0 0 0"/>
                        </StackPanel>
                        <Grid Margin="0 5">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Symbol" Margin="0 5"/>
                            <telerik:RadComboBox Grid.Column="1" SelectedValue="{Binding SelectedCurrencyInfo, Mode=TwoWay}" ItemsSource="{Binding CurrencyInfos}" VerticalAlignment="Top" Margin="3 0 0 0">
                                <telerik:RadComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding CurrencySymbol}" Width="37"/>
                                            <TextBlock Text="{Binding Culture.DisplayName}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:RadComboBox.ItemTemplate>
                            </telerik:RadComboBox>
                        </Grid>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DateCategoryContentStyle" TargetType="dialogs:DateCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:DateCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                                <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                            </telerik:GroupBox>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Type" Margin="0 5 0 0"/>
                        </StackPanel>
                        <telerik:RadListBox
                                ItemsSource="{Binding DateTimeItems}"
                                DisplayMemberPath="Text"
                                BorderThickness="1"
                                SelectedItem="{Binding SelectedDateTimeItem, Mode=TwoWay}"
                                Grid.Row="1"
                                Height="138"
                                Margin="0 2 0 0"/>
                        <StackPanel Grid.Row="2">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Locale" Margin="0 2"/>
                            <telerik:RadComboBox SelectedValue="{Binding SelectedCulture, Mode=TwoWay}" ItemsSource="{Binding CultureInfos}" DisplayMemberPath="DisplayName"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TimeCategoryContentStyle" TargetType="dialogs:TimeCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:TimeCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                                <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                            </telerik:GroupBox>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Type" Margin="0 5 0 0"/>
                        </StackPanel>
                        <telerik:RadListBox
                                ItemsSource="{Binding DateTimeItems}"
                                DisplayMemberPath="Text"
                                BorderThickness="1"
                                SelectedItem="{Binding SelectedDateTimeItem, Mode=TwoWay}"
                                Grid.Row="1"
                                Height="138"
                                Margin="0 2 0 0"/>
                        <StackPanel Grid.Row="2">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Locale" Margin="0 2"/>
                            <telerik:RadComboBox SelectedValue="{Binding SelectedCulture, Mode=TwoWay}" ItemsSource="{Binding CultureInfos}" DisplayMemberPath="DisplayName"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="PercentageCategoryContentStyle" TargetType="dialogs:PercentageCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:PercentageCategoryContent">
                    <StackPanel>
                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                            <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                        </telerik:GroupBox>
                        <StackPanel Orientation="Horizontal" Margin="0 5 5 0">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_DecimalPlaces" VerticalAlignment="Center" Margin="0 5 0 0"/>
                            <telerik:RadNumericUpDown Minimum="0" Value="{Binding DecimalPlaces, Mode=TwoWay}" VerticalAlignment="Top" IsInteger="True" Width="60" Margin="3 0 0 0"/>
                        </StackPanel>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FractionCategoryContentStyle" TargetType="dialogs:FractionCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FractionCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                                <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                            </telerik:GroupBox>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Type" Margin="0 5 0 0"/>
                        </StackPanel>
                        <telerik:RadListBox
                                ItemsSource="{Binding DisplayNameToFractionFormatStrings}"
                                Grid.Row="1"
                                DisplayMemberPath="Key"
                                BorderThickness="1"
                                SelectedValuePath="Value"
                                SelectedValue="{Binding SelectedFormat, Mode=TwoWay}"
                                Height="140"
                                Margin="0 2 0 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ScientificCategoryContentStyle" TargetType="dialogs:ScientificCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:ScientificCategoryContent">
                    <StackPanel>
                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                            <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                        </telerik:GroupBox>
                        <StackPanel Orientation="Horizontal" Margin="0 5 5 0">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_DecimalPlaces" VerticalAlignment="Center" Margin="0 5 0 0"/>
                            <telerik:RadNumericUpDown Minimum="0" Value="{Binding DecimalPlaces, Mode=TwoWay}" VerticalAlignment="Top" IsInteger="True" Width="60" Margin="3 0 0 0"/>
                        </StackPanel>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TextCategoryContentStyle" TargetType="dialogs:TextCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:TextCategoryContent">
                    <StackPanel>
                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                            <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                        </telerik:GroupBox>
                        <TextBlock TextWrapping="Wrap" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_TextInfo" Margin="0 5"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SpecialCategoryContentStyle" TargetType="dialogs:SpecialCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:SpecialCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                                <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                            </telerik:GroupBox>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Type" Margin="0 5 0 0"/>
                        </StackPanel>
                        <telerik:RadListBox
                                ItemsSource="{Binding SelectedFormatInfos}"
                                DisplayMemberPath="Name"
                                SelectedValuePath="FormatString"
                                SelectedValue="{Binding SelectedFormat, Mode=TwoWay}"
                                Grid.Row="1"
                                BorderThickness="1"
                                Height="138"
                                Margin="0 2 0 0"/>
                        <StackPanel Grid.Row="2">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Locale" Margin="0 2"/>
                            <telerik:RadComboBox ItemsSource="{Binding CultureInfos}" SelectedValue="{Binding SelectedCulture, Mode=TwoWay}" DisplayMemberPath="DisplayName"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CustomCategoryContentStyle" TargetType="dialogs:CustomCategoryContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CustomCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Sample" Height="44">
                                <TextBlock Text="{Binding Path=SampleValue}" Margin="5 5 5 0"/>
                            </telerik:GroupBox>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Type" Margin="0 5 0 0"/>
                            <TextBox Text="{Binding SelectedFormatString, Mode=TwoWay}" Margin="0 2 0 0"/>
                        </StackPanel>
                        <telerik:RadListBox ItemsSource="{Binding FormatStrings}" BorderThickness="1 0 1 1" SelectedValue="{Binding SelectedFormatString, Mode=TwoWay}" Grid.Row="1" MaxHeight="150"/>
                        <telerik:RadButton telerik:LocalizationManager.ResourceKey="Delete" HorizontalAlignment="Right" x:Name="deleteButton" Grid.Row="2" Height="23" MinWidth="75" Margin="0 9 0 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NumberTabContentStyle" TargetType="dialogs:NumberTabContent">
        <Setter Property="Height" Value="383"/>
        <Setter Property="Width" Value="525"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:NumberTabContent">
                    <Grid Margin="9 8">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Category"/>
                            <telerik:RadListBox
                                    ItemsSource="{Binding Path=Categories}"
                                    SelectedItem="{Binding Path=SelectedCategory, Mode=TwoWay}"
                                    ScrollViewer.VerticalScrollBarVisibility="Disabled"
                                    Height="275"
                                    Width="125"
                                    HorizontalAlignment="Left">
                                <telerik:RadListBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Converter={StaticResource FormatStringCategoryToStringConverter}}"/>
                                    </DataTemplate>
                                </telerik:RadListBox.ItemTemplate>
                            </telerik:RadListBox>
                        </StackPanel>
                        <ContentPresenter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="{Binding Path=CategoryContent}" Margin="10 16 0 4"/>
                        <TextBlock Text="{Binding Path=CategoryContent.Info}" TextWrapping="Wrap" Grid.ColumnSpan="2" Grid.Row="1" Margin="0 10 0 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FillTabContentStyle" TargetType="dialogs:FillTabContent">
        <Setter Property="Height" Value="383"/>
        <Setter Property="Width" Value="525"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FillTabContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="75"/>
                        </Grid.RowDefinitions>
                        <StackPanel HorizontalAlignment="Left" Margin="8 0 0 0">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_BackgroundColor" Margin="7 0 0 0"/>
                            <telerik:RadToggleButton x:Name="ButtonNoColor" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_NoColor" Margin="7 0 0 5"/>
                            <telerik:RadColorSelector x:Name="BackgroundColorSelector"
                                    AutomaticColor="White"
                                    SelectedColor="{Binding Path=BackgroundColor, Mode=TwoWay}"
                                    HeaderPaletteItemsSource="{Binding Path=ColorPalette.HeaderPaletteItemsSource}"
                                    MainPaletteItemsSource="{Binding Path=ColorPalette.MainPaletteItemsSource}"
                                    MainPaletteOrientation="{Binding Path=ColorPalette.MainPaletteOrientation}"
                                    Style="{StaticResource RadColorSelectorStylePredefined}"
                                    Margin="7 0 0 0"
                                    Width="178"/>
                            <Grid Margin="7 17 0 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <telerik:RadButton x:Name="FillEffectsButton" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_FillEffects" Height="23"/>
                                <telerik:RadButton x:Name="MoreColorsButton"
                                        Grid.Column="2"
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_MoreColors"
                                        HorizontalAlignment="Right"
                                        Margin="5 0 0 0"
                                        Height="23"/>
                            </Grid>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" Margin="0 0 50 0">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_PatternColor" Margin="7 0 0 0"/>
                            <spreadsheetControls:ColorSelectorDropDown x:Name="PatternsColorSelector"
                                    AutomaticColor="Black"
                                    SelectedColor="{Binding Path=PatternColor, Mode=TwoWay}"
                                    HeaderPaletteItemsSource="{Binding Path=ColorPalette.HeaderPaletteItemsSource}"
                                    MainPaletteItemsSource="{Binding Path=ColorPalette.MainPaletteItemsSource}"
                                    MainPaletteOrientation="{Binding Path=ColorPalette.MainPaletteOrientation}"
                                    Width="178"
                                    HorizontalAlignment="Left"
                                    Height="23"
                                    Margin="7 0 0 0"/>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_PatternStyle" Margin="7 0 0 0"/>
                            <telerik:RadDropDownButton x:Name="PatternStyleSelector" Width="178" HorizontalAlignment="Left" Margin="7 0 0 0" Height="23">
                                <telerik:RadDropDownButton.DropDownContent>
                                    <telerik:RadListBox x:Name="PatternListBox"
                                            Width="190"
                                            BorderThickness="0"
                                            ItemsSource="{Binding Path=PatternTypes}"
                                            SelectedIndex="{Binding Path=PatternType, Mode=TwoWay, Converter={StaticResource PatternTypeToIntConverter}}"
                                            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                            ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                            Height="115">
                                        <telerik:RadListBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <telerik:RadWrapPanel
                                                        Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                                                        Height="{Binding (FrameworkElement.ActualHeight), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                                                        VerticalAlignment="Top"
                                                        Orientation="Horizontal"/>
                                            </ItemsPanelTemplate>
                                        </telerik:RadListBox.ItemsPanel>
                                        <telerik:RadListBox.ItemTemplate>
                                            <DataTemplate>
                                                <spreadsheetControls:PatternFillControl
                                                        spreadsheetControls:RadControlsExtensions.ShouldCloseParentPopupOnClick="True"
                                                        Height="25"
                                                        Width="25"
                                                        ColorScheme="{Binding ElementName=PatternStyleSelector, Path=DataContext.ColorPalette.ColorScheme}"
                                                        PatternType="{Binding}"
                                                        PatternColor="#FF000000"
                                                        BackgroundColor="#FFFFFFFF"/>
                                            </DataTemplate>
                                        </telerik:RadListBox.ItemTemplate>
                                    </telerik:RadListBox>
                                </telerik:RadDropDownButton.DropDownContent>
                                <telerik:RadDropDownButton.Content>
                                    <spreadsheetControls:PatternFillControl x:Name="PatternDropDown"
                                            Height="17"
                                            Width="170"
                                            PatternColor="{Binding Path=PatternColor, Converter={StaticResource ColorToThemableColorConverter}}"
                                            BackgroundColor="#FFFFFFFF"
                                            ColorScheme="{Binding Path=ColorPalette.ColorScheme}"
                                            PatternType="{Binding Path=PatternType}"/>
                                </telerik:RadDropDownButton.Content>
                            </telerik:RadDropDownButton>
                        </StackPanel>
                        <telerik:GroupBox Grid.Row="1" Grid.ColumnSpan="2" Margin="2" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_Sample">
                            <Grid>
                                <spreadsheetControls:PatternFillControl x:Name="SamplePattern"
                                        Height="40"
                                        Width="489"
                                        Margin="5"
                                        ColorScheme="{Binding Path=ColorPalette.ColorScheme, RelativeSource={RelativeSource TemplatedParent}}"
                                        PatternType="{Binding Path=PatternType, RelativeSource={RelativeSource TemplatedParent}}"
                                        PatternColor="{Binding Path=PatternColor, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorToThemableColorConverter}}"
                                        BackgroundColor="{Binding Path=BackgroundColor, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ColorToThemableColorConverter}}"
                                        Visibility="{Binding Path=State, Converter={StaticResource FillTabStateToVisibilityConverter}, ConverterParameter=PatternFillControl}"/>
                                <spreadsheetControls:GradientFillControl x:Name="SampleGradient"
                                        Height="40"
                                        Width="489"
                                        Margin="5"
                                        Color1="{Binding Path=Color1, Converter={StaticResource ColorToThemableColorConverter}}"
                                        Color2="{Binding Path=Color2, Converter={StaticResource ColorToThemableColorConverter}}"
                                        GradientType="{Binding Path=GradientType, RelativeSource={RelativeSource TemplatedParent}}"
                                        ColorScheme="{Binding Path=ColorPalette.ColorScheme, RelativeSource={RelativeSource TemplatedParent}}"
                                        Visibility="{Binding Path=State, Converter={StaticResource FillTabStateToVisibilityConverter}, ConverterParameter=GradientFillControl}"/>
                            </Grid>
                        </telerik:GroupBox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="AlignmentTabContentStyle" TargetType="dialogs:AlignmentTabContent">
        <Setter Property="Height" Value="383"/>
        <Setter Property="Width" Value="525"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:AlignmentTabContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="352*"/>
                            <ColumnDefinition Width="130*"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_TextAlignment"/>
                                <Border Width="250" Height="1" BorderBrush="{StaticResource LineToTextSeparatorBrush}" BorderThickness="0 1 0 0"/>
                            </StackPanel>
                            <StackPanel Margin="10 0 0 0">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="145"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0">
                                        <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_Horizontal" Margin="-4 0 0 0"/>
                                        <telerik:RadComboBox x:Name="HorizontalAlignmentCombobox" ItemsSource="{Binding Path=HorizontalAlignments}" SelectedItem="{Binding Path=SelectedHorizontalAlignment, Mode=TwoWay}">
                                            <telerik:RadComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding Converter={StaticResource RadHorizontalAlignmentToStringConverter}}"/>
                                                </DataTemplate>
                                            </telerik:RadComboBox.ItemTemplate>
                                        </telerik:RadComboBox>
                                        <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_Vertical" Margin="-4 0 0 0"/>
                                        <telerik:RadComboBox x:Name="VerticalAlignmentCombobox" ItemsSource="{Binding Path=VerticalAlignments}" SelectedItem="{Binding Path=SelectedVerticalAlignment, Mode=TwoWay}">
                                            <telerik:RadComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding Converter={StaticResource RadVerticalAlignmentToStringConverter}}"/>
                                                </DataTemplate>
                                            </telerik:RadComboBox.ItemTemplate>
                                        </telerik:RadComboBox>
                                    </StackPanel>
                                    <StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="8 0 0 0">
                                        <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_Indent" Margin="-4 0 0 0" IsEnabled="{Binding Path=IsIndentEnabled}"/>
                                        <telerik:RadNumericUpDown Width="60" HorizontalAlignment="Left" Maximum="250" Minimum="0" Value="{Binding Path=Indent, Mode=TwoWay}"/>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                            <StackPanel Margin="0 3 0 0" Orientation="Horizontal">
                                <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_TextControl"/>
                                <Border Width="267" Height="1" BorderBrush="{StaticResource LineToTextSeparatorBrush}" BorderThickness="0 1 0 0"/>
                            </StackPanel>
                            <StackPanel Margin="10 0 0 0">
                                <CheckBox
                                        Margin="0 3 0 0"
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_WrapText"
                                        x:Name="WrapText"
                                        IsChecked="{Binding Path=IsWrapped, Mode=TwoWay}"/>
                                <CheckBox
                                        Margin="0 3 0 0"
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_MergeCells"
                                        IsEnabled="{Binding Path=IsMergingEnabled}"
                                        IsChecked="{Binding Path=IsMerged, Mode=TwoWay}"/>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FontTabContentStyle" TargetType="dialogs:FontTabContent">
        <Setter Property="Height" Value="383"/>
        <Setter Property="Width" Value="525"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FontTabContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="245*"/>
                            <ColumnDefinition Width="130*"/>
                            <ColumnDefinition Width="110*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_Font"/>
                            <TextBox x:Name="FontFamilyTextBox" TabIndex="0" Height="22"/>
                            <telerik:RadListBox x:Name="FontFamilyListBox"
                                    IsTabStop="False"
                                    BorderThickness="1 0 1 1"
                                    ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                    ItemsSource="{Binding Path=FontFamilyInfos}"
                                    SelectedItem="{Binding Path=FontFamilyInfo, Mode=TwoWay}"
                                    Height="88">
                                <telerik:RadListBox.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Text="{Binding Path=FontFamily.Source}" FontFamily="{Binding Path=FontFamily}" FontSize="11"/>
                                            <TextBlock Text="{Binding Path=ThemeFontType, Converter={StaticResource themeFontTypeToTextConverter}}" FontFamily="{Binding Path=FontFamily}" Grid.Column="1" FontSize="11"/>
                                        </Grid>
                                    </DataTemplate>
                                </telerik:RadListBox.ItemTemplate>
                            </telerik:RadListBox>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_Underline"/>
                            <telerik:RadComboBox x:Name="UnderlineCombobox" ItemsSource="{Binding Path=UnderlineTypes}" SelectedItem="{Binding Path=UnderlineType, Mode=TwoWay}" TabIndex="3" Height="24">
                                <telerik:RadComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Converter={StaticResource UnderlineTypesToStringConverter}}"/>
                                    </DataTemplate>
                                </telerik:RadComboBox.ItemTemplate>
                            </telerik:RadComboBox>
                        </StackPanel>
                        <StackPanel Grid.Row="0" Grid.Column="1" Margin="10 0 0 0">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_FontStyle"/>
                            <TextBox x:Name="FontStyleTextBox" TabIndex="1" Height="22"/>
                            <telerik:RadListBox x:Name="FontStyleListBox"
                                    BorderThickness="1 0 1 1"
                                    IsTabStop="False"
                                    ItemsSource="{Binding Path=FontStyles}"
                                    SelectedItem="{Binding Path=SelectedFontStyle, Mode=TwoWay}"
                                    Height="88">
                                <telerik:RadListBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock FontSize="11" Text="{Binding}"/>
                                    </DataTemplate>
                                </telerik:RadListBox.ItemTemplate>
                            </telerik:RadListBox>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_Color"/>
                            <spreadsheetControls:ColorSelectorDropDown x:Name="ForeColorSelector"
                                    AutomaticColor="Black"
                                    SelectedColor="{Binding Path=ForeColor, Mode=TwoWay}"
                                    HeaderPaletteItemsSource="{Binding Path=ColorPalette.HeaderPaletteItemsSource}"
                                    MainPaletteItemsSource="{Binding Path=ColorPalette.MainPaletteItemsSource}"
                                    MainPaletteOrientation="{Binding Path=ColorPalette.MainPaletteOrientation}"
                                    TabIndex="4"
                                    Height="24"/>
                        </StackPanel>
                        <StackPanel Grid.Column="3" Grid.Row="0" Margin="10 0 0 0">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_Size"/>
                            <TextBox x:Name="FontSizeTextBox" TabIndex="2" Height="22"/>
                            <telerik:RadListBox x:Name="FontSizeListBox"
                                    IsTabStop="False"
                                    BorderThickness="1 0 1 1"
                                    ItemsSource="{Binding Path=FontSizes}"
                                    SelectedItem="{Binding Path=SelectedFontSize, Mode=TwoWay}"
                                    Height="88">
                                <telerik:RadListBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock FontSize="11" Text="{Binding}"/>
                                    </DataTemplate>
                                </telerik:RadListBox.ItemTemplate>
                            </telerik:RadListBox>
                            <CheckBox x:Name="NormalFontCheckBox" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_NormalFont" TabIndex="5" Margin="0 26 0 0"/>
                        </StackPanel>
                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_Preview" Grid.Row="1" Grid.ColumnSpan="3" Height="74" Margin="0 4 0 0">
                            <Grid>
                                <Border BorderBrush="Black" BorderThickness="1">
                                    <TextBlock
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_AaBbCcYyZz"
                                            x:Name="SampleTextBlock"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                            TextWrapping="NoWrap"/>
                                </Border>
                            </Grid>
                        </telerik:GroupBox>
                        <TextBlock
                                telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_FontInfo"
                                Grid.Row="2"
                                Grid.ColumnSpan="3"
                                HorizontalAlignment="Center"
                                TextWrapping="Wrap"
                                Margin="2 50 0 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="BorderStyleSelectorStyle" TargetType="dialogs:BorderStyleSelector">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:BorderStyleSelector">
                    <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                        <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Line" Padding="3">
                            <StackPanel>
                                <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Style"/>
                                <Border BorderBrush="Black" BorderThickness="0.1">
                                    <telerik:RadListBox
                                            ItemsSource="{Binding Path=BorderStylesToLine}"
                                            SelectedIndex="{Binding Path=SelectedBorderStyleIndex, Mode=TwoWay}"
                                            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                            ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                            Height="115"
                                            x:Name="ListBoxBorders">
                                        <telerik:RadListBox.ItemTemplate>
                                            <DataTemplate>
                                                <Grid Height="9">
                                                    <Line
                                                            StrokeDashArray="{Binding StrokeDashArray}"
                                                            StrokeThickness="{Binding Thickness}"
                                                            Stroke="{Binding ElementName=ColorSelector, Path=SelectedColor, Converter={StaticResource ColorToBrushConverter}}"
                                                            X1="{Binding X1}"
                                                            Y1="{Binding Y1}"
                                                            X2="{Binding X2}"
                                                            Y2="{Binding Y2}"
                                                            Visibility="{Binding LineVisibility}"/>
                                                    <TextBlock
                                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_None"
                                                            HorizontalAlignment="Center"
                                                            VerticalAlignment="Center"
                                                            Visibility="{Binding TextBlockVisibility}"
                                                            Width="47"
                                                            FontSize="10"
                                                            FontFamily="Segoe UI"
                                                            Height="16"/>
                                                </Grid>
                                            </DataTemplate>
                                        </telerik:RadListBox.ItemTemplate>
                                        <telerik:RadListBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <telerik:RadWrapPanel
                                                        Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                                                        Height="{Binding (FrameworkElement.ActualHeight), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                                                        VerticalAlignment="Top"
                                                        Orientation="Vertical"/>
                                            </ItemsPanelTemplate>
                                        </telerik:RadListBox.ItemsPanel>
                                    </telerik:RadListBox>
                                </Border>
                                <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Color" Margin="0 5 0 0"/>
                                <spreadsheetControls:ColorSelectorDropDown x:Name="ColorSelector"
                                        HeaderPaletteItemsSource="{Binding Path=ColorPalette.HeaderPaletteItemsSource}"
                                        MainPaletteItemsSource="{Binding Path=ColorPalette.MainPaletteItemsSource}"
                                        MainPaletteOrientation="{Binding Path=ColorPalette.MainPaletteOrientation}"
                                        SelectedColor="{Binding Path=SelectedColor, Mode=TwoWay}"
                                        IsTabStop="False"/>
                            </StackPanel>
                        </telerik:GroupBox>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TransparentToggleButton" TargetType="telerik:RadToggleButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadToggleButton">
                    <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Fill="Transparent"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="BorderSelectorStyle" TargetType="dialogs:BorderSelector">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:BorderSelector">
                    <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="16"/>
                            <RowDefinition Height="68"/>
                            <RowDefinition Height="16"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Orientation="Horizontal">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Presets"/>
                            <Line
                                    X1="0"
                                    X2="200"
                                    Y1="0"
                                    Y2="0"
                                    StrokeThickness="1"
                                    Stroke="{StaticResource LineToTextSeparatorBrush}"
                                    VerticalAlignment="Center"
                                    Margin="5 0 0 0"
                                    UseLayoutRounding="True"/>
                        </StackPanel>
                        <Grid Grid.Row="1" HorizontalAlignment="Left" MinWidth="150" Margin="45 0 0 0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel VerticalAlignment="Center">
                                <telerik:RadButton Command="{Binding Path=SetNoBorderCommand}" x:Name="ButtonNoBorder" IsTabStop="False" Width="38" Height="38">
                                    <Image Width="32" Source="{telerik:IconResource IconRelativePath=32/noBorders.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadButton>
                                <TextBlock HorizontalAlignment="Center" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_None"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <telerik:RadButton Command="{Binding Path=SetOutsideBorderCommand}" x:Name="ButtonOutlineBorder" IsTabStop="False" Width="38" Height="38">
                                    <Image Width="32" Source="{telerik:IconResource IconRelativePath=32/outsideBorders.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadButton>
                                <TextBlock HorizontalAlignment="Center" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Outline"/>
                            </StackPanel>
                            <StackPanel Grid.Column="2" VerticalAlignment="Center">
                                <telerik:RadButton Command="{Binding Path=SetInsideBorderCommand}" x:Name="ButtonInsideBorder" IsTabStop="False" Width="38" Height="38">
                                    <Image Width="32" Source="{telerik:IconResource IconRelativePath=32/insideBorder.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadButton>
                                <TextBlock HorizontalAlignment="Center" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Inside"/>
                            </StackPanel>
                        </Grid>
                        <telerik:RadWrapPanel Grid.Row="2">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Border"/>
                            <Line
                                    X1="0"
                                    X2="203"
                                    Y1="0"
                                    Y2="0"
                                    StrokeThickness="1"
                                    Stroke="{StaticResource LineToTextSeparatorBrush}"
                                    VerticalAlignment="Center"
                                    Margin="7 0 0 0"
                                    UseLayoutRounding="True"/>
                        </telerik:RadWrapPanel>
                        <Grid Grid.Row="3" HorizontalAlignment="Left" Width="220" Margin="10 5 0 0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <telerik:RadToggleButton Grid.Row="0" Command="{Binding Path=ToggleTopBorderCommand}" x:Name="ToggleButtonTopBorderVisibility" IsTabStop="False" Width="23" Height="23">
                                    <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/topBorder.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        Grid.Row="1"
                                        Command="{Binding Path=ToggleInsideHorizontalBorderCommand}"
                                        x:Name="ToggleButtonInsideHorizontalBorderVisibility"
                                        IsTabStop="False"
                                        Width="23"
                                        Height="23">
                                    <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/insideHorizontalBorder.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton Grid.Row="2" Command="{Binding Path=ToggleBottomBorderCommand}" x:Name="ToggleButtonBottomBorderVisibility" IsTabStop="False" Width="23" Height="23">
                                    <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/bottomBorder.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadToggleButton>
                            </Grid>
                            <telerik:RadToggleButton
                                    Grid.Column="0"
                                    Grid.Row="2"
                                    Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                    x:Name="ToggleButtonDiagonalUpBorderVisibility"
                                    IsTabStop="False"
                                    Width="23"
                                    Height="23">
                                <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/diagonalUp.png, IconSources={StaticResource IconPaths}}" UseLayoutRounding="False"/>
                            </telerik:RadToggleButton>
                            <Grid Grid.Row="2" Grid.Column="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <telerik:RadToggleButton Command="{Binding Path=ToggleLeftBorderCommand}" x:Name="ToggleButtonLeftBorderVisibility" IsTabStop="False" Width="23" Height="23">
                                    <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/leftBorder.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        Grid.Column="1"
                                        Command="{Binding Path=ToggleInsideVerticalBorderCommand}"
                                        telerik:RadDockPanel.Dock="Left"
                                        x:Name="ToggleButtonInsideVerticalBorderVisibility"
                                        IsTabStop="False"
                                        Width="23"
                                        Height="23">
                                    <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/insideVerticalBorder.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton Grid.Column="2" Command="{Binding Path=ToggleRightBorderCommand}" x:Name="ToggleButtonRightBorderVisibility" IsTabStop="False" Width="23" Height="23">
                                    <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/rightBorder.png, IconSources={StaticResource IconPaths}}"/>
                                </telerik:RadToggleButton>
                            </Grid>
                            <telerik:RadToggleButton
                                    Grid.Column="4"
                                    Grid.Row="2"
                                    Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                    x:Name="ToggleButtonDiagonalDownBorderVisibility"
                                    IsTabStop="False"
                                    Width="23"
                                    Height="23">
                                <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/diagonalDown.png, IconSources={StaticResource IconPaths}}"/>
                            </telerik:RadToggleButton>
                            <Grid Grid.Column="2">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="8"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="9"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="54"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="54"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="9"/>
                                </Grid.ColumnDefinitions>
                                <dialogs:BordersPreview
                                        SelectedColumnsCount="{Binding Path=SelectedColumnsCount}"
                                        SelectedRowsCount="{Binding Path=SelectedRowsCount}"
                                        DiagonalDownBorder="{Binding Path=DiagonalDownBorder, Mode=TwoWay}"
                                        DiagonalUpBorder="{Binding Path=DiagonalUpBorder, Mode=TwoWay}"
                                        TopBorder="{Binding Path=TopBorder, Mode=TwoWay}"
                                        RightBorder="{Binding Path=RightBorder, Mode=TwoWay}"
                                        BottomBorder="{Binding Path=BottomBorder, Mode=TwoWay}"
                                        LeftBorder="{Binding Path=LeftBorder, Mode=TwoWay}"
                                        InsideVerticalBorder="{Binding Path=InsideVerticalBorder, Mode=TwoWay}"
                                        InsideHorizontalBorder="{Binding Path=InsideHorizontalBorder, Mode=TwoWay}"
                                        ColorPalette="{Binding Path=ColorPalette}"
                                        x:Name="BordersPreview"
                                        Grid.ColumnSpan="7"
                                        Grid.RowSpan="7"
                                        Background="{StaticResource BordersPreviewBackgroundBrush}"
                                        Foreground="{StaticResource BordersPreviewForegroundBrush}"/>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineFourCellsDownRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="31" CenterX="-61" CenterY="93"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineFourCellsDownRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="149" CenterX="47" CenterY="42"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineFourCellsUpRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="31" CenterX="7" CenterY="75"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineFourCellsUpRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="149" CenterX="52" CenterY="22"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineFourCellsUpLeft"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="31" CenterX="-25" CenterY="-38"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineFourCellsUpLeft"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="149" CenterX="21" CenterY="14"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineFourCellsDownLeft"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="31" CenterX="-94" CenterY="-20"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="80"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineFourCellsDownLeft"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=FourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="149" CenterX="16" CenterY="33"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="138"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineTowHorizontalCellsUp"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoVerticalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="17" CenterX="-23" CenterY="15"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="138"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineTowHorizontalCellsUp"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoVerticalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="163" CenterX="67" CenterY="18"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="138"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineTowHorizontalCellsRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoVerticalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="17" CenterX="-148" CenterY="39"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="138"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineTowHorizontalCellsRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoVerticalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="163" CenterX="64" CenterY="37"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="105"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineTowVerticalCellsLeft"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoHorizontalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="51" CenterX="-10" CenterY="-6"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="105"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineTowVerticalCellsLeft"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoHorizontalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="129" CenterX="26" CenterY="20"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="105"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineTowVerticalCellsRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoHorizontalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="51" CenterX="20" CenterY="59"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="105"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineTowVerticalCellsRight"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=TwoHorizontalCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="129" CenterX="58" CenterY="35"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="150"
                                        Height="9"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalDownBorderCommand}"
                                        x:Name="ToggleButtonDownBorderVisibilityLineOneOrFourCells"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=OneOrFourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="31" CenterX="-7" CenterY="26"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="150"
                                        Height="9"
                                        Grid.Row="6"
                                        Grid.ColumnSpan="7"
                                        Command="{Binding Path=ToggleDiagonalUpBorderCommand}"
                                        x:Name="ToggleButtonUpBorderVisibilityLineOneOrFourCells"
                                        Style="{StaticResource TransparentToggleButton}"
                                        Visibility="{Binding Path=OneOrFourCellsDiagonalsVisibility}">
                                    <telerik:RadToggleButton.RenderTransform>
                                        <RotateTransform Angle="149" CenterX="82" CenterY="-19"/>
                                    </telerik:RadToggleButton.RenderTransform>
                                </telerik:RadToggleButton>
                                <telerik:RadToggleButton
                                        Grid.Row="3"
                                        Grid.Column="2"
                                        Grid.ColumnSpan="3"
                                        Command="{Binding Path=ToggleInsideHorizontalBorderCommand}"
                                        x:Name="ToggleButtonInsideHorizontalBorderVisibilityLine"
                                        Style="{StaticResource TransparentToggleButton}"/>
                                <telerik:RadToggleButton
                                        Grid.Row="1"
                                        Grid.Column="3"
                                        Grid.RowSpan="4"
                                        Command="{Binding Path=ToggleInsideVerticalBorderCommand}"
                                        x:Name="ToggleButtonInsideVerticalBorderVisibilityLine"
                                        Style="{StaticResource TransparentToggleButton}"/>
                                <telerik:RadToggleButton x:Name="ToggleButtonLeftBorderVisibilityLine"
                                        Grid.Row="1"
                                        Grid.Column="1"
                                        Grid.RowSpan="5"
                                        Command="{Binding Path=ToggleLeftBorderCommand}"
                                        Style="{StaticResource TransparentToggleButton}"/>
                                <telerik:RadToggleButton x:Name="ToggleButtonTopBorderVisibilityLine"
                                        Grid.Row="1"
                                        Grid.Column="2"
                                        Grid.ColumnSpan="3"
                                        Command="{Binding Path=ToggleTopBorderCommand}"
                                        Style="{StaticResource TransparentToggleButton}"/>
                                <telerik:RadToggleButton x:Name="ToggleButtonRightBorderVisibilityLine"
                                        Grid.Row="1"
                                        Grid.Column="5"
                                        Grid.RowSpan="5"
                                        Command="{Binding Path=ToggleRightBorderCommand}"
                                        Style="{StaticResource TransparentToggleButton}"/>
                                <telerik:RadToggleButton x:Name="ToggleButtonBottomBorderVisibilityLine"
                                        Grid.Row="5"
                                        Grid.Column="2"
                                        Grid.ColumnSpan="3"
                                        Command="{Binding Path=ToggleBottomBorderCommand}"
                                        Style="{StaticResource TransparentToggleButton}"/>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="BorderTabContentStyle" TargetType="dialogs:BorderTabContent">
        <Setter Property="Height" Value="383"/>
        <Setter Property="Width" Value="525"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:BorderTabContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="135"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="243"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <dialogs:BorderStyleSelector x:Name="TableBorderSelector" CurrentBorder="{Binding Path=CurrentBorder, Mode=TwoWay}" Margin="5 0 0 0" ColorPalette="{Binding Path=ColorPalette}"/>
                        <dialogs:BorderSelector x:Name="BorderSelector"
                                Grid.Column="1"
                                UseLayoutRounding="True"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Stretch"
                                LeftBorder="{Binding Path=LeftBorder, Mode=TwoWay}"
                                TopBorder="{Binding Path=TopBorder, Mode=TwoWay}"
                                RightBorder="{Binding Path=RightBorder, Mode=TwoWay}"
                                BottomBorder="{Binding Path=BottomBorder, Mode=TwoWay}"
                                InsideHorizontalBorder="{Binding Path=InsideHorizontalBorder, Mode=TwoWay}"
                                InsideVerticalBorder="{Binding Path=InsideVerticalBorder, Mode=TwoWay}"
                                DiagonalDownBorder="{Binding Path=DiagonalDownBorder, Mode=TwoWay}"
                                DiagonalUpBorder="{Binding Path=DiagonalUpBorder, Mode=TwoWay}"
                                SelectedColumnsCount="{Binding Path=SelectedColumnsCount}"
                                SelectedRowsCount="{Binding Path=SelectedRowsCount}"
                                CurrentBorder="{Binding Path=CurrentBorder}"
                                ColorPalette="{Binding Path=ColorPalette}"
                                Margin="10 0 0 0"/>
                        <TextBlock Grid.Row="1" Grid.ColumnSpan="2" TextWrapping="Wrap" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Info" Margin="0 10 0 0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ProtectionTabContentStyle" TargetType="dialogs:ProtectionTabContent">
        <Setter Property="Height" Value="383"/>
        <Setter Property="Width" Value="525"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:ProtectionTabContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <StackPanel>
                            <CheckBox Margin="5 10 5 0" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Protection_Locked" IsChecked="{Binding Path=IsLocked, Mode=TwoWay}"/>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Protection_Info" Margin="5"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FormatCellsDialogContentStyle" TargetType="dialogs:FormatCellsDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_FormatCellsDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="MaxWidth" Value="750"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FormatCellsDialogContent">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="205*"/>
                            <RowDefinition Height="40"/>
                        </Grid.RowDefinitions>
                        <telerik:RadTabControl x:Name="TabControl" Margin="-1 0">
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Header" x:Name="NumberTab" MinWidth="55">
                                <dialogs:NumberTabContent x:Name="NumberTabContent"/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_Header" x:Name="AlignmentTab" MinWidth="55">
                                <dialogs:AlignmentTabContent x:Name="AlignmentTabContent"/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_Header" x:Name="FontTab" MinWidth="55">
                                <dialogs:FontTabContent x:Name="FontTabContent"/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Header" x:Name="BorderTab" MinWidth="55">
                                <dialogs:BorderTabContent x:Name="BorderTabContent"/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_Header" x:Name="FillTab" MinWidth="55">
                                <dialogs:FillTabContent x:Name="FillTabContent"/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Protection_Header" x:Name="ProtectionTab" MinWidth="55">
                                <dialogs:ProtectionTabContent x:Name="ProtectionTabContent"/>
                            </telerik:RadTabItem>
                        </telerik:RadTabControl>
                        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOK"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5" x:Name="PART_ButtonCancel"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DecimalNumberPromptDialogStyle" TargetType="dialogs:DecimalNumberPromptDialogContent">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Width" Value="220"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:DecimalNumberPromptDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid Margin="0 5 0 20">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock VerticalAlignment="Center" Text="{Binding Path=LabelText, StringFormat='\{0\}:'}"/>
                            <TextBox x:Name="PART_NumberTextBox" HorizontalAlignment="Stretch" Margin="5 0 0 0" Grid.Column="1"/>
                        </Grid>
                        <Grid Grid.Row="1" Margin="0 5 0 0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton x:Name="PART_OKButton" MinWidth="75" Height="23" Margin="0 0 10 0" HorizontalAlignment="Left" telerik:LocalizationManager.ResourceKey="Ok"/>
                            <telerik:RadButton x:Name="PART_CancelButton" Grid.Column="1" MinWidth="75" Height="23" HorizontalAlignment="Right" telerik:LocalizationManager.ResourceKey="Cancel"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="InsertCellsDialogStyle" TargetType="dialogs:InsertCellsDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_InsertCellsDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:InsertCellsDialogContent">
                    <StackPanel Background="{TemplateBinding Background}" Margin="7" Orientation="Vertical">
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertCellsDialog_Insert"/>
                        <StackPanel Margin="5 10">
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertCellsDialog_ShiftCellsRight"
                                    x:Name="ShiftRightRadioButton"
                                    GroupName="InsertCells"
                                    Tag="ShiftRight"
                                    Margin="0 2"/>
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertCellsDialog_ShiftCellsDown"
                                    x:Name="ShiftDownRadioButton"
                                    GroupName="InsertCells"
                                    IsChecked="true"
                                    Tag="ShiftDown"
                                    Margin="0 2"/>
                            <RadioButton telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertCellsDialog_EntireRow" x:Name="EntireRowRadioButton" GroupName="InsertCells" Tag="EntireRow" Margin="0 2"/>
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertCellsDialog_EntireColumn"
                                    x:Name="EntireColumnRadioButton"
                                    GroupName="InsertCells"
                                    Tag="EntireColumn"
                                    Margin="0 2"/>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton x:Name="PART_OKButton" MinWidth="75" Height="23" Margin="0 0 10 0" HorizontalAlignment="Left" telerik:LocalizationManager.ResourceKey="Ok"/>
                            <telerik:RadButton x:Name="PART_CancelButton" Grid.Column="2" MinWidth="75" Height="23" HorizontalAlignment="Right" telerik:LocalizationManager.ResourceKey="Cancel"/>
                        </Grid>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RemoveCellsDialogStyle" TargetType="dialogs:RemoveCellsDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_RemoveCellsDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:RemoveCellsDialogContent">
                    <StackPanel Background="{TemplateBinding Background}" Margin="7" Orientation="Vertical">
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_RemoveCellsDialog_Delete"/>
                        <StackPanel Margin="5 10">
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_RemoveCellsDialog_ShiftCellsLeft"
                                    x:Name="ShiftLeftRadioButton"
                                    GroupName="RemoveCells"
                                    Tag="ShiftLEft"
                                    Margin="0 2"/>
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_RemoveCellsDialog_ShiftCellsUp"
                                    x:Name="ShiftUpRadioButton"
                                    GroupName="RemoveCells"
                                    IsChecked="true"
                                    Tag="ShiftUp"
                                    Margin="0 2"/>
                            <RadioButton telerik:LocalizationManager.ResourceKey="Spreadsheet_RemoveCellsDialog_EntireRow" x:Name="EntireRowRadioButton" GroupName="RemoveCells" Tag="EntireRow" Margin="0 2"/>
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_RemoveCellsDialog_EntireColumn"
                                    x:Name="EntireColumnRadioButton"
                                    GroupName="RemoveCells"
                                    Tag="EntireColumn"
                                    Margin="0 2"/>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton x:Name="PART_OKButton" MinWidth="75" Height="23" Margin="0 0 10 0" HorizontalAlignment="Left" telerik:LocalizationManager.ResourceKey="Ok"/>
                            <telerik:RadButton x:Name="PART_CancelButton" Grid.Column="2" MinWidth="75" Height="23" HorizontalAlignment="Right" telerik:LocalizationManager.ResourceKey="Cancel"/>
                        </Grid>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ScaleFactorDialogStyle" TargetType="dialogs:ScaleFactorDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_ScaleFactorDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:ScaleFactorDialogContent">
                    <StackPanel Background="{TemplateBinding Background}" Margin="7">
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_ScaleFactorDialog_Magnification"/>
                        <StackPanel Margin="5 10">
                            <StackPanel x:Name="PART_RadioButtonsPanel">
                                <RadioButton Content="250%" GroupName="Percentage" Tag="250" Margin="0 2"/>
                                <RadioButton Content="200%" GroupName="Percentage" Tag="200" Margin="0 2"/>
                                <RadioButton Content="150%" GroupName="Percentage" Tag="150" Margin="0 2"/>
                                <RadioButton Content="100%" GroupName="Percentage" Tag="100" Margin="0 2"/>
                                <RadioButton Content="75%" GroupName="Percentage" Tag="75" Margin="0 2"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <RadioButton
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_ScaleFactorDialog_Custom"
                                        x:Name="CustomScaleFactorRadioButton"
                                        VerticalAlignment="Center"
                                        GroupName="Percentage"
                                        Margin="0 2"/>
                                <TextBox x:Name="CustomScaleFactorTextBox" VerticalAlignment="Center" MaxLength="3" Margin="2 0" Width="32"/>
                                <TextBlock VerticalAlignment="Center" Text="%"/>
                            </StackPanel>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton x:Name="PART_OKButton" MinWidth="75" Height="23" Margin="0 0 10 0" HorizontalAlignment="Left" telerik:LocalizationManager.ResourceKey="Ok"/>
                            <telerik:RadButton x:Name="PART_CancelButton" Grid.Column="2" MinWidth="75" Height="23" HorizontalAlignment="Right" telerik:LocalizationManager.ResourceKey="Cancel"/>
                        </Grid>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="InsertFunctionDialogContentStyle" TargetType="dialogs:InsertFunctionDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_InsertFunctionDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="MinWidth" Value="450"/>
        <Setter Property="MinHeight" Value="390"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:InsertFunctionDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_SearchForAFunction" Margin="3 0"/>
                            <StackPanel Orientation="Horizontal" Margin="0 5" HorizontalAlignment="Center">
                                <TextBox telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Type" x:Name="SearchText" TextWrapping="Wrap" Width="345" Height="40" FontSize="11"/>
                                <telerik:RadButton x:Name="SearchButton"
                                        VerticalAlignment="Top"
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Go"
                                        Height="23"
                                        MinWidth="75"
                                        Margin="12 0 0 0"/>
                            </StackPanel>
                            <StackPanel Margin="0 5" Orientation="Horizontal">
                                <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_SelectCategory"/>
                                <telerik:RadComboBox x:Name="SelectCategory" Width="191">
                                    <telerik:RadComboBox.Items>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_MostRecentlyUsed"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_All"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Financial"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_DateTime"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_MathTrig"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Statistical"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_LookupReference"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Text"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Logical"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Information"/>
                                        <telerik:RadComboBoxItem telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_Engineering"/>
                                    </telerik:RadComboBox.Items>
                                </telerik:RadComboBox>
                            </StackPanel>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertFunctionDialog_SelectAFunction" Margin="5 0 0 0"/>
                            <telerik:RadListBox x:Name="FunctionsList" Margin="5" HorizontalContentAlignment="Stretch" Height="96"/>
                            <TextBlock x:Name="FunctionSyntax" Margin="5 4 0 0" FontWeight="Bold" Text="{Binding Path=SelectedFunction.FunctionInfo.Syntax}"/>
                            <TextBlock x:Name="FunctionDescription" Text="{Binding Path=SelectedFunction.FunctionInfo.Description}" TextWrapping="Wrap" Margin="0" Width="430"/>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Orientation="Vertical">
                            <Border Height="1" Margin="4 0 4 8" BorderBrush="{StaticResource SeparatorLightBrush}" BorderThickness="1"/>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOK"/>
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonCancel"/>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FunctionArgumentsDialogContentStyle" TargetType="dialogs:FunctionArgumentsDialogContent">
        <Setter Property="Header" Value="Insert Function"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FunctionArgumentsDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid Visibility="{Binding DefaultModeViewVisibility}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <telerik:GroupBox Header="{Binding FunctionName}" Margin="5" Visibility="{Binding ParameterizedFunctionMetadataVisibility}">
                                <telerik:RadListBox x:Name="PART_ArgumentsList" MaxHeight="160" Background="{TemplateBinding Background}"/>
                            </telerik:GroupBox>
                            <StackPanel Grid.Row="1">
                                <StackPanel Orientation="Horizontal" Visibility="{Binding ParameterizedFunctionMetadataVisibility}">
                                    <TextBlock Text="=" VerticalAlignment="Center" Margin="338 0 0 0"/>
                                    <TextBlock Text="{Binding FunctionResult}" VerticalAlignment="Center"/>
                                </StackPanel>
                                <TextBlock Text="{Binding FunctionDescription}" VerticalAlignment="Center" MaxWidth="325" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="7 4 7 0"/>
                                <StackPanel Orientation="Horizontal" Margin="158 0 0 0" Visibility="{Binding ParameterizedFunctionMetadataVisibility}">
                                    <TextBlock Text="{Binding CurrentArgumentName}" FontWeight="Bold"/>
                                    <TextBlock Text="{Binding CurrentArgumentDescription}" MaxWidth="275" TextWrapping="Wrap" Margin="7 0 0 0"/>
                                </StackPanel>
                            </StackPanel>
                            <StackPanel Orientation="Vertical" Grid.Row="2">
                                <Border Height="1" BorderThickness="1" BorderBrush="{StaticResource SeparatorLightBrush}" Margin="4 0 4 8"/>
                                <StackPanel Margin="7 0 0 0" Orientation="Horizontal">
                                    <TextBlock Text="Formula result ="/>
                                    <TextBlock Text="{Binding FunctionResult}"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                    <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOk"/>
                                    <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonCancel"/>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                        <StackPanel Orientation="Horizontal" Visibility="{Binding SelectionModeViewVisibility}">
                            <TextBox x:Name="ValueTextBox" Width="450" VerticalAlignment="Center" Text="{Binding ArgumentValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                            <telerik:RadButton x:Name="ExitSelectionModeButton" VerticalAlignment="Center" Margin="5 0 0 0">
                                <Image Source="{telerik:IconResource IconRelativePath=16/exitSelectionMode.png, IconSources={StaticResource IconPaths}}"/>
                            </telerik:RadButton>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="InsertFunctionArgumentControlStyle" TargetType="dialogs:InsertFunctionArgumentControl">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:InsertFunctionArgumentControl">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="110"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="30"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding ArgumentName}" VerticalAlignment="Center" FontSize="11" FontWeight="Bold" Margin="7 0 0 0" Grid.Column="0"/>
                        <TextBox Text="{Binding ArgumentValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" x:Name="PART_ValueTextBox" VerticalAlignment="Center" Width="170" Grid.Column="1"/>
                        <telerik:RadButton x:Name="EnterSelectionModeButton" VerticalAlignment="Center" Grid.Column="2" Margin="5 0 0 0">
                            <Image Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/16/enterSelectionMode.png" Stretch="None"/>
                        </telerik:RadButton>
                        <TextBlock Text="=" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="3"/>
                        <TextBlock
                                Text="{Binding ArgumentStatus}"
                                FontWeight="Bold"
                                TextTrimming="WordEllipsis"
                                FontSize="11"
                                Foreground="{Binding ArgumentTypeForeground}"
                                VerticalAlignment="Center"
                                Grid.Column="4"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="StyleDialogContentStyle" TargetType="dialogs:StyleDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_StyleDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="MinWidth" Value="274"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:StyleDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleDialog_StyleName" VerticalAlignment="Center" Margin="5 0"/>
                                <TextBox x:Name="StyleNameTextBox"
                                        Text="{Binding Path=StyleName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                        IsEnabled="{Binding Path=IsStyleNameTextBoxEnabled}"
                                        Width="200"/>
                            </StackPanel>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleDialog_Format" x:Name="FormatButton" HorizontalAlignment="Right" Margin="0 5 0 0" MinWidth="75"/>
                        </StackPanel>
                        <Grid Grid.Row="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid Margin="0 10 0 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_StyleDialog_StyleIncludes"/>
                                <Rectangle Grid.Column="1" Margin="5 0 0 0" UseLayoutRounding="True" Height="1" HorizontalAlignment="Stretch" Fill="{StaticResource LineToTextSeparatorBrush}"/>
                            </Grid>
                            <Grid Grid.Row="1" Margin="5">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="14"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Number_Header" IsChecked="{Binding Path=IncludeNumber, Mode=TwoWay}" Margin="0 2"/>
                                <TextBlock Text="{Binding Path=NumberProperties}" Grid.Column="2" Grid.Row="0" Margin="14 2"/>
                                <CheckBox
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Alignment_Header"
                                        Grid.Row="1"
                                        IsChecked="{Binding Path=IncludeAlignment, Mode=TwoWay}"
                                        Margin="0 2"/>
                                <TextBlock Text="{Binding Path=AlignmentProperties}" Grid.Column="2" Grid.Row="1" Margin="14 2"/>
                                <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Font_Header" Grid.Row="2" IsChecked="{Binding Path=IncludeFont, Mode=TwoWay}" Margin="0 2"/>
                                <TextBlock Text="{Binding Path=FontProperties}" Grid.Column="2" Grid.Row="2" Margin="14 2"/>
                                <CheckBox
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Border_Header"
                                        Grid.Row="3"
                                        IsChecked="{Binding Path=IncludeBorder, Mode=TwoWay}"
                                        Margin="0 2"/>
                                <TextBlock Text="{Binding Path=BorderProperties}" Grid.Column="2" Grid.Row="3" Margin="14 2"/>
                                <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Fill_Header" Grid.Row="4" IsChecked="{Binding Path=IncludeFill, Mode=TwoWay}" Margin="0 2"/>
                                <TextBlock Text="{Binding Path=FillProperties}" Grid.Column="2" Grid.Row="4" Margin="14 2"/>
                                <CheckBox
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatCellsDialog_Protection_Header"
                                        Grid.Row="5"
                                        IsChecked="{Binding Path=IncludeProtection, Mode=TwoWay}"
                                        Margin="0 2"/>
                                <TextBlock Text="{Binding Path=ProtectionProperties}" Grid.Column="2" Grid.Row="5" Margin="14 2"/>
                            </Grid>
                        </Grid>
                        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="2">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOK"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonCancel"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SelectColorDialogStyle" TargetType="dialogs:SelectColorDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_SelectColorDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:SelectColorDialogContent">
                    <Grid x:Name="LayoutRoot" Margin="5 4">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <telerik:RadTabControl HeaderBackground="{TemplateBinding Background}">
                                <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_SelectColorDialog_Standard">
                                    <spreadsheetControls:RadHexagonColorPicker
                                            UseSmoothColorTransition="False"
                                            SelectedColor="{Binding ElementName=PART_ColorEditor, Path=SelectedColor, Mode=TwoWay}"
                                            Width="220"
                                            Height="253"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"/>
                                </telerik:RadTabItem>
                                <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_SelectColorDialog_Custom">
                                    <telerik:RadColorEditor x:Name="PART_ColorEditor" AlphaSettingsVisibility="Collapsed" ActiveSections="HueSaturationPad, LuminancePad, ColorModesPanel" Margin="0 0 5 0" Width="375"/>
                                </telerik:RadTabItem>
                            </telerik:RadTabControl>
                            <Grid Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel VerticalAlignment="Bottom" Margin="0 5">
                                    <TextBlock HorizontalAlignment="Center" telerik:LocalizationManager.ResourceKey="Spreadsheet_SelectColorDialog_New"/>
                                    <Border Width="50" BorderThickness="1" BorderBrush="Black">
                                        <StackPanel>
                                            <Rectangle Fill="{Binding ElementName=PART_ColorEditor, Path=SelectedColor, Converter={StaticResource ColorToBrushConverter}}" Height="25"/>
                                            <Rectangle Height="25" Fill="White"/>
                                        </StackPanel>
                                    </Border>
                                    <TextBlock HorizontalAlignment="Center" telerik:LocalizationManager.ResourceKey="Spreadsheet_SelectColorDialog_Current"/>
                                </StackPanel>
                                <StackPanel Grid.Column="1" Margin="10 5 0 0" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
                                    <telerik:RadButton x:Name="PART_OKButton" telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                                    <telerik:RadButton x:Name="PART_CancelButton" telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CreateNewThemeColorSampleControlStyle" TargetType="dialogs:CreateNewThemeColorSampleControl">
        <Setter Property="Width" Value="85"/>
        <Setter Property="Height" Value="165"/>
        <Setter Property="Margin" Value="0 10"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CreateNewThemeColorSampleControl">
                    <Grid>
                        <Rectangle Fill="{Binding Path=BackgroundColor, Converter={StaticResource ColorToBrushConverter}}"/>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Text"
                                    Foreground="{Binding Path=TextColor, Converter={StaticResource ColorToBrushConverter}}"
                                    HorizontalAlignment="Center"
                                    FontWeight="Bold"
                                    FontSize="12"
                                    Margin="0 12 0 0"/>
                            <Grid VerticalAlignment="Top" Grid.Row="1">
                                <Rectangle Width="32" Height="24" VerticalAlignment="Top" Margin="18 10 0 0">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint="1, 1" EndPoint="0, 1">
                                            <GradientStopCollection>
                                                <GradientStop Color="{Binding Path=Accent1}" Offset="0"/>
                                                <GradientStop Color="White" Offset="1"/>
                                            </GradientStopCollection>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                    <Rectangle.Effect>
                                        <DropShadowEffect ShadowDepth="2" BlurRadius="1" Opacity="0.8" Color="{StaticResource ThemeControlDropShadowEffectColor}"/>
                                    </Rectangle.Effect>
                                </Rectangle>
                                <Ellipse
                                        Fill="{Binding Path=CircleColor, Converter={StaticResource ColorToBrushConverter}}"
                                        Height="25"
                                        Width="25"
                                        StrokeThickness="1"
                                        Stroke="{Binding Path=Accent1, Converter={StaticResource ColorToBrushConverter}}"
                                        Margin="-15 21 3 0">
                                    <Ellipse.Effect>
                                        <DropShadowEffect ShadowDepth="2" BlurRadius="1" Opacity="0.8" Color="{StaticResource ThemeControlDropShadowEffectColor}"/>
                                    </Ellipse.Effect>
                                </Ellipse>
                                <Line
                                        Stroke="{Binding Path=Accent1, Converter={StaticResource ColorToBrushConverter}}"
                                        StrokeDashArray="1 1"
                                        StrokeDashOffset="1"
                                        StrokeThickness="1"
                                        X1="0"
                                        X2="8"
                                        Y1="0"
                                        Y2="0"
                                        Width="8"
                                        Height="1"
                                        Margin="-24 15 0 0"/>
                                <Line
                                        Stroke="{Binding Path=Accent1, Converter={StaticResource ColorToBrushConverter}}"
                                        StrokeDashArray="1 1"
                                        StrokeThickness="1"
                                        X1="0"
                                        X2="10"
                                        Y1="0"
                                        Y2="0"
                                        Width="10"
                                        Height="1"
                                        Margin="-22 17 0 0"/>
                            </Grid>
                            <Grid Grid.Row="2" Width="72" Margin="0 10 0 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border
                                        BorderBrush="{Binding Path=ChartBorderColor, Converter={StaticResource ColorToBrushConverter}}"
                                        BorderThickness="1 1 0 0"
                                        Grid.Column="1"
                                        VerticalAlignment="Bottom">
                                    <Rectangle Fill="{Binding Path=Accent1, Converter={StaticResource ColorToBrushConverter}}" Height="10" Width="9"/>
                                </Border>
                                <Border
                                        BorderBrush="{Binding Path=ChartBorderColor, Converter={StaticResource ColorToBrushConverter}}"
                                        BorderThickness="1 1 0 0"
                                        Grid.Column="2"
                                        VerticalAlignment="Bottom">
                                    <Rectangle Fill="{Binding Path=Accent2, Converter={StaticResource ColorToBrushConverter}}" Height="20" Width="9"/>
                                </Border>
                                <Border
                                        BorderBrush="{Binding Path=ChartBorderColor, Converter={StaticResource ColorToBrushConverter}}"
                                        BorderThickness="1 1 1 0"
                                        Grid.Column="3"
                                        VerticalAlignment="Bottom">
                                    <Rectangle Fill="{Binding Path=Accent3, Converter={StaticResource ColorToBrushConverter}}" Height="30" Width="9"/>
                                </Border>
                                <Border
                                        BorderBrush="{Binding Path=ChartBorderColor, Converter={StaticResource ColorToBrushConverter}}"
                                        BorderThickness="0 1 1 0"
                                        Grid.Column="4"
                                        VerticalAlignment="Bottom">
                                    <Rectangle Fill="{Binding Path=Accent4, Converter={StaticResource ColorToBrushConverter}}" Height="23" Width="9"/>
                                </Border>
                                <Border
                                        BorderBrush="{Binding Path=ChartBorderColor, Converter={StaticResource ColorToBrushConverter}}"
                                        BorderThickness="0 1 1 0"
                                        Grid.Column="5"
                                        VerticalAlignment="Bottom">
                                    <Rectangle Fill="{Binding Path=Accent5, Converter={StaticResource ColorToBrushConverter}}" Height="17" Width="9"/>
                                </Border>
                                <Border
                                        BorderBrush="{Binding Path=ChartBorderColor, Converter={StaticResource ColorToBrushConverter}}"
                                        BorderThickness="0 1 1 0"
                                        Grid.Column="6"
                                        VerticalAlignment="Bottom">
                                    <Rectangle Fill="{Binding Path=Accent6, Converter={StaticResource ColorToBrushConverter}}" Height="8" Width="9"/>
                                </Border>
                                <Border
                                        BorderBrush="{Binding Path=ChartBorderColor, Converter={StaticResource ColorToBrushConverter}}"
                                        BorderThickness="1"
                                        Height="1"
                                        Grid.ColumnSpan="8"
                                        VerticalAlignment="Bottom"/>
                            </Grid>
                            <TextBlock
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Hyperlink"
                                    TextDecorations="Underline"
                                    Foreground="{Binding Path=Hyperlink, Converter={StaticResource ColorToBrushConverter}}"
                                    Grid.Row="3"
                                    Margin="0 10 0 0"
                                    HorizontalAlignment="Center"/>
                            <TextBlock
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Hyperlink"
                                    TextDecorations="Underline"
                                    Foreground="{Binding Path=FollowedHyperlink, Converter={StaticResource ColorToBrushConverter}}"
                                    Grid.Row="4"
                                    HorizontalAlignment="Center"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CreateNewThemeColorsDialogContentStyle" TargetType="dialogs:CreateNewThemeColorsDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_CreateNewThemeColorsDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CreateNewThemeColorsDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="5" MinWidth="454" MinHeight="450">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <telerik:GroupBox Margin="6" telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_ThemeColors" Padding="2 3 3 3">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="45"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_TextBackGroundDark1" VerticalAlignment="Center"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Dark1" SelectedColor="{Binding Path=Text1, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_TextBackGroundLight1" VerticalAlignment="Center" Grid.Row="1"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Light1" SelectedColor="{Binding Path=Background1, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_TextBackGroundDark2" VerticalAlignment="Center" Grid.Row="2"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Dark2" SelectedColor="{Binding Path=Text2, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_TextBackGroundLight2" VerticalAlignment="Center" Grid.Row="3"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Light2" SelectedColor="{Binding Path=Background2, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="3" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Accent1" VerticalAlignment="Center" Grid.Row="4"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Accent1" SelectedColor="{Binding Path=Accent1, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="4" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Accent2" VerticalAlignment="Center" Grid.Row="5"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Accent2" SelectedColor="{Binding Path=Accent2, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="5" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Accent3" VerticalAlignment="Center" Grid.Row="6"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Accent3" SelectedColor="{Binding Path=Accent3, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="6" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Accent4" VerticalAlignment="Center" Grid.Row="7"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Accent4" SelectedColor="{Binding Path=Accent4, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="7" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Accent5" VerticalAlignment="Center" Grid.Row="8"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Accent5" SelectedColor="{Binding Path=Accent5, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="8" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Accent6" VerticalAlignment="Center" Grid.Row="9"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Accent6" SelectedColor="{Binding Path=Accent6, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="9" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Hyperlink" VerticalAlignment="Center" Grid.Row="10"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="Hyperlink" SelectedColor="{Binding Path=Hyperlink, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="10" VerticalAlignment="Center"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_FollowedHyperlink" VerticalAlignment="Center" Grid.Row="11"/>
                                        <spreadsheetControls:ColorSelectorDropDown x:Name="FollowedHyperlink" SelectedColor="{Binding Path=FollowedHyperlink, Mode=TwoWay}" Margin="4 0 0 0" Grid.Column="1" Grid.Row="11" VerticalAlignment="Center"/>
                                    </Grid>
                                </telerik:GroupBox>
                                <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Sample" VerticalAlignment="Top" Grid.Column="1" Margin="6">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>
                                        <dialogs:CreateNewThemeColorSampleControl
                                                HorizontalAlignment="Right"
                                                Accent1="{Binding ElementName=Accent1, Path=SelectedColor}"
                                                Accent2="{Binding ElementName=Accent2, Path=SelectedColor}"
                                                Accent3="{Binding ElementName=Accent3, Path=SelectedColor}"
                                                Accent4="{Binding ElementName=Accent4, Path=SelectedColor}"
                                                Accent5="{Binding ElementName=Accent5, Path=SelectedColor}"
                                                Accent6="{Binding ElementName=Accent6, Path=SelectedColor}"
                                                BackgroundColor="{Binding ElementName=Dark2, Path=SelectedColor}"
                                                ChartBorderColor="White"
                                                CircleColor="{Binding ElementName=Light1, Path=SelectedColor}"
                                                FollowedHyperlink="{Binding ElementName=FollowedHyperlink, Path=SelectedColor}"
                                                Hyperlink="{Binding ElementName=Hyperlink, Path=SelectedColor}"
                                                TextColor="{Binding ElementName=Light1, Path=SelectedColor}"/>
                                        <dialogs:CreateNewThemeColorSampleControl
                                                Grid.Column="1"
                                                HorizontalAlignment="Left"
                                                Accent1="{Binding ElementName=Accent1, Path=SelectedColor}"
                                                Accent2="{Binding ElementName=Accent2, Path=SelectedColor}"
                                                Accent3="{Binding ElementName=Accent3, Path=SelectedColor}"
                                                Accent4="{Binding ElementName=Accent4, Path=SelectedColor}"
                                                Accent5="{Binding ElementName=Accent5, Path=SelectedColor}"
                                                Accent6="{Binding ElementName=Accent6, Path=SelectedColor}"
                                                BackgroundColor="{Binding ElementName=Light2, Path=SelectedColor}"
                                                ChartBorderColor="Black"
                                                CircleColor="{Binding ElementName=Light1, Path=SelectedColor}"
                                                FollowedHyperlink="{Binding ElementName=FollowedHyperlink, Path=SelectedColor}"
                                                Hyperlink="{Binding ElementName=Hyperlink, Path=SelectedColor}"
                                                TextColor="{Binding ElementName=Dark1, Path=SelectedColor}"/>
                                    </Grid>
                                </telerik:GroupBox>
                                <Grid Grid.Row="1" Grid.ColumnSpan="2" Margin="8 0 7 6">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeColorsDialog_Name" VerticalAlignment="Center"/>
                                    <TextBox Text="{Binding Path=SchemeName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10 0 0 0" HorizontalAlignment="Stretch" Grid.Column="1" MaxWidth="396"/>
                                </Grid>
                            </Grid>
                        </Border>
                        <Grid Grid.Row="1" Margin="7 0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton
                                    telerik:LocalizationManager.ResourceKey="Reset"
                                    Command="{Binding Path=ResetCommand}"
                                    IsEnabled="{Binding Path=IsResetButtonEnabled}"
                                    HorizontalAlignment="Left"
                                    Height="23"
                                    MinWidth="75"
                                    x:Name="PART_ButtonReset"/>
                            <StackPanel Orientation="Horizontal" Grid.Column="1">
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Save" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOK"/>
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonCancel"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CreateNewThemeFontsDialogContentStyle" TargetType="dialogs:CreateNewThemeFontsDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_CreateNewThemeFontsDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="MinHeight" Value="205"/>
        <Setter Property="MinWidth" Value="453"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CreateNewThemeFontsDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="7 10 7 7">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Margin="0 0 10 0">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeFontsDialog_HeadingFont" Margin="0 0 0 2"/>
                                <telerik:RadComboBox ItemsSource="{Binding Path=Fonts}" SelectedItem="{Binding Path=Major, Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"/>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeFontsDialog_BodyFont" Margin="0 5 0 2"/>
                                <telerik:RadComboBox ItemsSource="{Binding Path=Fonts}" SelectedItem="{Binding Path=Minor, Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeFontsDialog_Sample" Margin="0 0 0 2"/>
                                <RichTextBox
                                        IsReadOnly="True"
                                        IsHitTestVisible="False"
                                        IsTabStop="False"
                                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                                        ScrollViewer.VerticalScrollBarVisibility="Disabled"
                                        Width="219"
                                        Height="100">
                                    <FlowDocument>
                                        <FlowDocument.Resources>
                                            <Style TargetType="{x:Type Paragraph}">
                                                <Setter Property="Margin" Value="0 5"/>
                                            </Style>
                                        </FlowDocument.Resources>
                                        <Paragraph FontFamily="{Binding Path=Major}" FontSize="22">
                                            <Run telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeFontsDialog_Heading"/>
                                        </Paragraph>
                                        <Paragraph FontFamily="{Binding Path=Minor}" FontSize="12">
                                            <Run telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeFontsDialog_BodyText1"/>
                                            <LineBreak/>
                                            <Run telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeFontsDialog_BodyText2"/>
                                        </Paragraph>
                                    </FlowDocument>
                                </RichTextBox>
                            </StackPanel>
                            <Grid Grid.ColumnSpan="2" Grid.Row="1" Margin="0 10 0 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateNewThemeFontsDialog_Name" VerticalAlignment="Center"/>
                                <TextBox Text="{Binding Path=SchemeName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="10 0 0 0" HorizontalAlignment="Stretch" Grid.Column="1" MaxWidth="398"/>
                            </Grid>
                        </Grid>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Margin="0 5 0 0">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Save" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOK"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonCancel"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FormatShapesDialogContentStyle" TargetType="dialogs:FormatShapesDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_FormatShapesDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="MinHeight" Value="205"/>
        <Setter Property="MinWidth" Value="345"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FormatShapesDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_SizeAndRotate"/>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition MinWidth="50" Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_Width" VerticalAlignment="Center"/>
                                    <telerik:RadNumericUpDown
                                            Grid.Column="1"
                                            Value="{Binding CommonWidth, Mode=TwoWay, TargetNullValue=''}"
                                            Minimum="0.1"
                                            CustomUnit="{Binding Path=RegionalUnitString}"
                                            SmallChange="0.1"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommand="{Binding Path=SetShapeWidthCommand}"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Value}"
                                            Width="90"
                                            Margin="3"/>
                                </Grid>
                                <Grid Grid.Column="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_Height" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                                    <telerik:RadNumericUpDown
                                            Grid.Column="1"
                                            Value="{Binding CommonHeight, Mode=TwoWay, TargetNullValue=''}"
                                            Minimum="0.1"
                                            SmallChange="0.1"
                                            CustomUnit="{Binding Path=RegionalUnitString}"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommand="{Binding Path=SetShapeHeightCommand}"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Value}"
                                            Width="90"
                                            Margin="3"/>
                                </Grid>
                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition MinWidth="50" Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_Rotation" VerticalAlignment="Center"/>
                                    <telerik:RadNumericUpDown
                                            Grid.Column="1"
                                            Value="{Binding Rotation, Mode=TwoWay, TargetNullValue=''}"
                                            Minimum="-3600"
                                            Maximum="3600"
                                            CustomUnit="°"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommand="{Binding Path=SetShapeRotationCommand}"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Value}"
                                            Width="90"
                                            Margin="3"/>
                                </Grid>
                            </Grid>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_Scale"/>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition MinWidth="50" Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition MinWidth="50" Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_Width" VerticalAlignment="Center"/>
                                    <telerik:RadNumericUpDown
                                            Grid.Column="1"
                                            Value="{Binding WidthScale, Mode=TwoWay, TargetNullValue=''}"
                                            Minimum="1"
                                            SmallChange="1"
                                            CustomUnit="%"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommand="{Binding Path=SetScaleWidthCommand}"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Value}"
                                            Width="90"
                                            Margin="3"/>
                                </Grid>
                                <Grid Grid.Column="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_Height" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                                    <telerik:RadNumericUpDown
                                            Grid.Column="1"
                                            Value="{Binding HeightScale, Mode=TwoWay, TargetNullValue=''}"
                                            Minimum="1"
                                            SmallChange="1"
                                            CustomUnit="%"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommand="{Binding Path=SetScaleHeightCommand}"
                                            spreadsheetControls:RadNumericUpDownExtensions.UIInteractionCommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Value}"
                                            Width="90"
                                            Margin="3"/>
                                </Grid>
                            </Grid>
                            <CheckBox
                                    Command="{Binding Path=ChangeLockAspectRatioCommand}"
                                    CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}"
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_LockAspectRatio"
                                    IsChecked="{Binding InitialLockAspectRatio, Mode=OneTime}"
                                    Margin="5 10 5 5"/>
                            <CheckBox
                                    Command="{Binding Path=ChangeRelativeToOriginalResizeCommand}"
                                    CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}"
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_Relative"
                                    IsChecked="{Binding InitialRelativeToOriginalResize, Mode=OneTime}"
                                    IsEnabled="{Binding RelativeToOriginalResizeIsEnabled, Mode=OneTime}"
                                    Margin="5 0 5 5"/>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_OriginalSize" Margin="0 5 0 0"/>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Visibility="{Binding Path=SelectionHasImages, Converter={StaticResource BoolToVisibilityValueConverter}}" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_OriginalWidth" Margin="0 2 5 2"/>
                                <TextBlock Visibility="{Binding Path=SelectionHasImages, Converter={StaticResource BoolToVisibilityValueConverter}}" Text="{Binding OriginalWidth, Mode=OneTime}" Margin="0 2 5 2"/>
                                <TextBlock Visibility="{Binding Path=SelectionHasImages, Converter={StaticResource BoolToVisibilityValueConverter}}" telerik:LocalizationManager.ResourceKey="Spreadsheet_FormatShapesDialog_OriginalHeight" Margin="5 2"/>
                                <TextBlock Visibility="{Binding Path=SelectionHasImages, Converter={StaticResource BoolToVisibilityValueConverter}}" Text="{Binding OriginalHeight, Mode=OneTime}" Margin="0 2 5 2"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Grid.Row="2" Margin="0 10 0 0">
                            <telerik:RadButton
                                    telerik:LocalizationManager.ResourceKey="Reset"
                                    Visibility="{Binding Path=SelectionHasImages, Converter={StaticResource BoolToVisibilityValueConverter}}"
                                    Command="{Binding Path=ResetCommand}"
                                    Height="23"
                                    MinWidth="75"
                                    Margin="10 5 0 5"/>
                            <telerik:RadButton Command="{Binding Path=CloseCommand}" telerik:LocalizationManager.ResourceKey="Close" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SeriesDialogContentStyle" TargetType="dialogs:SeriesDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_SeriesDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="MinHeight" Value="200"/>
        <Setter Property="MinWidth" Value="251"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:SeriesDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_SeriesIn" Margin="0" HorizontalAlignment="Left">
                                <StackPanel>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Rows"
                                            GroupName="1"
                                            IsChecked="{Binding Path=SeriesOrientation, Converter={StaticResource SeriesOrientationToBooleanConverter}, ConverterParameter=Horizontal, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Columns"
                                            GroupName="2"
                                            IsChecked="{Binding Path=SeriesOrientation, Converter={StaticResource SeriesOrientationToBooleanConverter}, ConverterParameter=Vertical, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                </StackPanel>
                            </telerik:GroupBox>
                            <telerik:GroupBox telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Type" Margin="5 0" HorizontalAlignment="Center" Grid.Column="1">
                                <StackPanel>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Linear"
                                            GroupName="3"
                                            IsChecked="{Binding Path=Type, Converter={StaticResource SeriesTypeToBooleanConverter}, ConverterParameter=Linear, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Growth"
                                            GroupName="4"
                                            IsChecked="{Binding Path=Type, Converter={StaticResource SeriesTypeToBooleanConverter}, ConverterParameter=Growth, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Date"
                                            GroupName="5"
                                            IsEnabled="{Binding Path=IsTrend, Converter={StaticResource BooleanToInversedBooleanConverter}}"
                                            IsChecked="{Binding Path=Type, Converter={StaticResource SeriesTypeToBooleanConverter}, ConverterParameter=Date, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_AutoFill"
                                            GroupName="6"
                                            IsEnabled="{Binding Path=IsTrend, Converter={StaticResource BooleanToInversedBooleanConverter}}"
                                            IsChecked="{Binding Path=Type, Converter={StaticResource SeriesTypeToBooleanConverter}, ConverterParameter=AutoFill, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                </StackPanel>
                            </telerik:GroupBox>
                            <telerik:GroupBox
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_DateUnit"
                                    IsEnabled="{Binding Path=IsDateUnitEnabled}"
                                    Margin="0"
                                    Grid.Column="2"
                                    HorizontalAlignment="Right">
                                <StackPanel>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Day"
                                            GroupName="7"
                                            IsChecked="{Binding Path=DateUnit, Converter={StaticResource SeriesDateUnitToBooleanConverter}, ConverterParameter=Day, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Weekday"
                                            GroupName="8"
                                            IsChecked="{Binding Path=DateUnit, Converter={StaticResource SeriesDateUnitToBooleanConverter}, ConverterParameter=Weekday, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Month"
                                            GroupName="9"
                                            IsChecked="{Binding Path=DateUnit, Converter={StaticResource SeriesDateUnitToBooleanConverter}, ConverterParameter=Month, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                    <RadioButton
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Year"
                                            GroupName="10"
                                            IsChecked="{Binding Path=DateUnit, Converter={StaticResource SeriesDateUnitToBooleanConverter}, ConverterParameter=Year, Mode=TwoWay}"
                                            Margin="0 3 0 0"/>
                                </StackPanel>
                            </telerik:GroupBox>
                        </Grid>
                        <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_Trend" IsChecked="{Binding Path=IsTrend, Mode=TwoWay}" Margin="0 7" Grid.Row="1"/>
                        <Grid Grid.Row="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_StepValue" Margin="0 0 5 0" VerticalAlignment="Center"/>
                                <TextBox Text="{Binding Path=StepValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=IsTextBoxesEnabled}" Width="54"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="2" HorizontalAlignment="Right">
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_SeriesDialog_StopValue" Margin="0 0 5 0" VerticalAlignment="Center"/>
                                <TextBox Text="{Binding Path=StopValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=IsTextBoxesEnabled}" Width="54"/>
                            </StackPanel>
                        </Grid>
                        <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Grid.Row="3">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonOK"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_ButtonCancel"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HyperlinkDialogContentStyle" TargetType="dialogs:HyperlinkDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_InsertHyperlinkDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:HyperlinkDialogContent">
                    <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
                        <Grid Margin="5">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_LinkTo" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Border Grid.Row="1" Grid.RowSpan="2" BorderThickness="1" BorderBrush="{StaticResource LineToTextSeparatorBrush}" Margin="0 0 5 1">
                                <StackPanel>
                                    <telerik:RadRadioButton Width="80" MinHeight="70" x:Name="PART_WebPageButton" Margin="10 5" UseLayoutRounding="True" IsBackgroundVisible="False">
                                        <StackPanel>
                                            <Image Width="16" Stretch="None" Source="{telerik:IconResource IconRelativePath=16/existingFileOrWebPage.png, IconSources={StaticResource IconPaths}}"/>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_WebPage" TextWrapping="Wrap" HorizontalAlignment="Center"/>
                                        </StackPanel>
                                    </telerik:RadRadioButton>
                                    <telerik:RadRadioButton x:Name="PART_InDocumentButton" Width="80" MinHeight="70" Margin="10 5" UseLayoutRounding="True" IsBackgroundVisible="False">
                                        <StackPanel>
                                            <Image Width="16" Stretch="None" Source="{telerik:IconResource IconRelativePath=16/placeInThisDocument.png, IconSources={StaticResource IconPaths}}"/>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_PlaceInDocument" TextWrapping="Wrap" HorizontalAlignment="Center"/>
                                        </StackPanel>
                                    </telerik:RadRadioButton>
                                    <telerik:RadRadioButton x:Name="PART_EmailButton" Width="80" MinHeight="70" Margin="10 5" UseLayoutRounding="True" IsBackgroundVisible="False">
                                        <StackPanel>
                                            <Image Width="16" Stretch="None" Source="{telerik:IconResource IconRelativePath=16/eMailAddress.png, IconSources={StaticResource IconPaths}}"/>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_EMailAddress" TextWrapping="Wrap" HorizontalAlignment="Center"/>
                                        </StackPanel>
                                    </telerik:RadRadioButton>
                                </StackPanel>
                            </Border>
                            <TextBlock
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_TextToDisplay"
                                    Grid.Column="1"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Left"
                                    Margin="2 5"/>
                            <TextBox x:Name="TextToDisplay" Grid.Column="2" Margin="3" Width="350" Text="{Binding TextToDisplay, Mode=TwoWay}" MaxLength="255" IsEnabled="{Binding ShouldApplyCellValue}"/>
                            <TextBlock
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_ScreenTip"
                                    Grid.Column="1"
                                    Grid.Row="1"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Left"
                                    Margin="2 5"/>
                            <TextBox x:Name="ScreenTip" Grid.Row="1" Grid.Column="2" Margin="3" Width="350" Text="{Binding ScreenTip, Mode=TwoWay}" MaxLength="255"/>
                            <ContentPresenter Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" x:Name="PART_ContentPresenter" Margin="0 3 0 0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.ColumnSpan="3" Margin="2 5" Grid.Row="3">
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_OKButton"/>
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5" x:Name="PART_CancelButton"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HyperlinkWebPageCategoryContentStyle" TargetType="dialogs:HyperlinkWebPageCategoryContent">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:HyperlinkWebPageCategoryContent">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <StackPanel Width="439">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_Address" VerticalAlignment="Center" Margin="2 1"/>
                            <TextBox x:Name="Address" Grid.Row="1" Text="{Binding Address, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MaxLength="255" Margin="2 1"/>
                        </StackPanel>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_RecentlyUsedWebPages" Grid.Row="1" Grid.ColumnSpan="2" Margin="2 1"/>
                        <telerik:RadListBox x:Name="SelectedAddress" Grid.Row="2" SelectedItem="{Binding SelectedAddress, Mode=TwoWay}" ItemsSource="{Binding UsedWebPages}" Margin="2 1" Width="435" Height="148"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HyperlinkInDocumentCategoryContentStyle" TargetType="dialogs:HyperlinkInDocumentCategoryContent">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:HyperlinkInDocumentCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <StackPanel Width="439">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_TypeTheCellReference" TextWrapping="Wrap" VerticalAlignment="Center" Margin="2 1"/>
                            <TextBox x:Name="CellReference" Grid.Row="1" Text="{Binding CellReference, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MaxLength="255" Margin="2 1"/>
                        </StackPanel>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_RecentlyUsedCellReferences" Grid.Row="1" Grid.ColumnSpan="2" Margin="2 1"/>
                        <telerik:RadListBox x:Name="SelectedAddress"
                                SelectedItem="{Binding SelectedAddress, Mode=TwoWay}"
                                Height="148"
                                Grid.Row="2"
                                ItemsSource="{Binding UsedCellReferences}"
                                Margin="2 1"
                                Width="435"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HyperlinkEmailCategoryContentStyle" TargetType="dialogs:HyperlinkEmailCategoryContent">
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:HyperlinkEmailCategoryContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <StackPanel Width="439">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_EMailAddressColumn" VerticalAlignment="Center" Margin="2 1"/>
                            <TextBox x:Name="EmailAddress" Grid.Row="1" Text="{Binding EmailAddress, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MaxLength="255" Margin="2 1"/>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Width="439">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_Subject" TextWrapping="Wrap" VerticalAlignment="Center" Margin="2 1"/>
                            <TextBox x:Name="EmailSubject" Grid.Row="1" Text="{Binding EmailSubject, Mode=TwoWay}" MaxLength="255" Margin="2 1"/>
                        </StackPanel>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_InsertHyperlinkDialog_RecentlyUsedEMailAddresses" Grid.Row="2" Grid.ColumnSpan="2" Margin="2 1"/>
                        <telerik:RadListBox x:Name="SelectedAddress" SelectedItem="{Binding SelectedAddress, Mode=TwoWay}" Grid.Row="3" ItemsSource="{Binding UsedEmails}" Height="106" Margin="2 1" Width="435"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FindAndReplaceDialogContentStyle" TargetType="dialogs:FindAndReplaceDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_FindAndReplaceDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="HostWindowMinWidth" Value="470"/>
        <Setter Property="MaxHeight" Value="560"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForeground_Normal}"/>
        <Setter Property="HostWindowMinHeight" Value="237"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FindAndReplaceDialogContent">
                    <Grid x:Name="Container" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition MinHeight="138" Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <telerik:RadTabControl x:Name="TabControl" BorderThickness="0">
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Find"/>
                            <telerik:RadTabItem x:Name="ReplaceTabItem" telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Replace"/>
                        </telerik:RadTabControl>
                        <Grid Grid.Row="1" Margin="8">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto" MinHeight="32"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_FindWhat"/>
                            <TextBox x:Name="FindWhat" Grid.Column="1" MinWidth="327" Text="{Binding Path=SearchedWord, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
                            <telerik:Label
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_ReplaceWith"
                                    Grid.Row="1"
                                    Margin="0 5"
                                    Visibility="{Binding ElementName=ReplaceTabItem,Path=IsSelected,Converter={StaticResource SpreadsheetBooleanToVisibilityConverter}}"/>
                            <TextBox
                                    Grid.Row="1"
                                    MinWidth="327"
                                    Grid.Column="1"
                                    Text="{Binding Path=ReplaceWithWord, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                    Margin="0 5"
                                    Visibility="{Binding ElementName=ReplaceTabItem,Path=IsSelected,Converter={StaticResource SpreadsheetBooleanToVisibilityConverter}}"/>
                            <Grid Grid.Row="2" Grid.ColumnSpan="2" Margin="0 10 0 0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid x:Name="OptionsContainer">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="29"/>
                                        <RowDefinition Height="29"/>
                                        <RowDefinition Height="29"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="55"/>
                                        <ColumnDefinition Width="100"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Within"/>
                                    <telerik:RadComboBox
                                            Grid.Column="1"
                                            Margin="0 3"
                                            ItemsSource="{Binding Path=WithinValues, Mode=OneWay}"
                                            DisplayMemberPath="Name"
                                            SelectedValuePath="SearchLocation"
                                            SelectedValue="{Binding Path=SearchWithinValue, Mode=TwoWay}"/>
                                    <telerik:Label Grid.Row="1" telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Search"/>
                                    <telerik:RadComboBox
                                            Grid.Row="1"
                                            Grid.Column="1"
                                            Margin="0 3"
                                            ItemsSource="{Binding Path=SearchBy, Mode=OneWay}"
                                            DisplayMemberPath="Name"
                                            SelectedValuePath="SearchLocation"
                                            SelectedValue="{Binding Path=SearchByType, Mode=TwoWay}"/>
                                    <telerik:Label Grid.Row="2" telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_LookIn"/>
                                    <telerik:RadComboBox
                                            Grid.Row="2"
                                            Grid.Column="1"
                                            Margin="0 3"
                                            ItemsSource="{Binding Path=LookInValues, Mode=OneWay}"
                                            DisplayMemberPath="Name"
                                            SelectedValuePath="SearchLocation"
                                            SelectedValue="{Binding Path=LookIn, Mode=TwoWay}"/>
                                    <StackPanel Grid.Column="2" Grid.RowSpan="3">
                                        <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_MatchCase" Margin="5 3" IsChecked="{Binding Path=MatchCase, Mode=TwoWay}"/>
                                        <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_MatchEntireContent" Margin="5 3" IsChecked="{Binding Path=MatchEntireCellContents, Mode=TwoWay}"/>
                                    </StackPanel>
                                </Grid>
                            </Grid>
                        </Grid>
                        <Grid Grid.Row="2" Margin="5" HorizontalAlignment="Right">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Horizontal" Visibility="{Binding ElementName=ReplaceTabItem, Path=IsSelected, Converter={StaticResource SpreadsheetBooleanToVisibilityConverter}}">
                                <telerik:RadButton
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_ReplaceAll"
                                        Margin="0 0 5 0"
                                        Height="23"
                                        MinWidth="75"
                                        Command="{Binding Path=ReplaceAllCommand}"/>
                                <telerik:RadButton
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Replace"
                                        Margin="0 0 5 0"
                                        Height="23"
                                        MinWidth="75"
                                        Command="{Binding Path=ReplaceCommand}"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="10 0 0 0">
                                <telerik:RadButton
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_FindAll"
                                        Margin="0 0 5 0"
                                        Height="23"
                                        MinWidth="75"
                                        Command="{Binding Path=FindAllCommand}"/>
                                <telerik:RadButton
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_FindNext"
                                        Margin="0 0 5 0"
                                        Height="23"
                                        MinWidth="75"
                                        Command="{Binding Path=FindNextCommand}"/>
                            </StackPanel>
                            <StackPanel Grid.Column="2" Orientation="Horizontal" Margin="10 0 0 0">
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Close" Margin="0 0 5 0" Height="23" MinWidth="75" Command="{Binding Path=CloseDialogCommand}"/>
                            </StackPanel>
                        </Grid>
                        <StackPanel Grid.Row="3" Visibility="{Binding ResultsGridVisibility}">
                            <grid:RadGridView x:Name="ResultsGridView"
                                    ItemsSource="{Binding Path=FindAllResults}"
                                    RowIndicatorVisibility="Collapsed"
                                    IsReadOnly="True"
                                    AutoGenerateColumns="False"
                                    CanUserFreezeColumns="False"
                                    ShowGroupPanel="False"
                                    VerticalAlignment="Top"
                                    MaxWidth="450"
                                    MaxHeight="295"
                                    BorderThickness="0 1 0 0">
                                <grid:RadGridView.Columns>
                                    <grid:GridViewColumn MinWidth="75">
                                        <grid:GridViewColumn.Header>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_SheetColumn"/>
                                        </grid:GridViewColumn.Header>
                                        <grid:GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <Button
                                                        Content="{Binding Path=FoundCell.Worksheet.Name}"
                                                        Command="{Binding RelativeSource={RelativeSource AncestorType=grid:RadGridView} , Path=DataContext.GoToCellCommand}"
                                                        CommandParameter="{Binding Path=FoundCell}"
                                                        Style="{StaticResource LinkButtonStyle}"/>
                                            </DataTemplate>
                                        </grid:GridViewColumn.CellTemplate>
                                    </grid:GridViewColumn>
                                    <grid:GridViewColumn MinWidth="75">
                                        <grid:GridViewColumn.Header>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Cell"/>
                                        </grid:GridViewColumn.Header>
                                        <grid:GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <Button
                                                        Content="{Binding Path=FoundCell.CellIndex, Converter={StaticResource CellIndexToNameConverter}}"
                                                        Command="{Binding RelativeSource={RelativeSource AncestorType=grid:RadGridView} , Path=DataContext.GoToCellCommand}"
                                                        CommandParameter="{Binding Path=FoundCell}"
                                                        Style="{StaticResource LinkButtonStyle}"/>
                                            </DataTemplate>
                                        </grid:GridViewColumn.CellTemplate>
                                    </grid:GridViewColumn>
                                    <grid:GridViewColumn MinWidth="75">
                                        <grid:GridViewColumn.Header>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Value"/>
                                        </grid:GridViewColumn.Header>
                                        <grid:GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <Button
                                                        Content="{Binding Path=ResultValue}"
                                                        Command="{Binding RelativeSource={RelativeSource AncestorType=grid:RadGridView} , Path=DataContext.GoToCellCommand}"
                                                        CommandParameter="{Binding Path=FoundCell}"
                                                        Style="{StaticResource LinkButtonStyle}"/>
                                            </DataTemplate>
                                        </grid:GridViewColumn.CellTemplate>
                                    </grid:GridViewColumn>
                                    <grid:GridViewColumn MinWidth="75">
                                        <grid:GridViewColumn.Header>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_FindAndReplaceDialog_Formula"/>
                                        </grid:GridViewColumn.Header>
                                        <grid:GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <Button
                                                        Content="{Binding Path=RawValue}"
                                                        Command="{Binding RelativeSource={RelativeSource AncestorType=grid:RadGridView} , Path=DataContext.GoToCellCommand}"
                                                        CommandParameter="{Binding Path=FoundCell}"
                                                        Style="{StaticResource LinkButtonStyle}"/>
                                            </DataTemplate>
                                        </grid:GridViewColumn.CellTemplate>
                                    </grid:GridViewColumn>
                                </grid:RadGridView.Columns>
                            </grid:RadGridView>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NameManagerDialogContentStyle" TargetType="dialogs:NameManagerDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_NameManagerDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Width" Value="545"/>
        <Setter Property="Height" Value="355"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:NameManagerDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel Orientation="Horizontal">
                            <telerik:RadButton x:Name="New"
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_New"
                                    Command="{Binding Path=CreateDefinedName}"
                                    Margin="0 0 5 0"
                                    Height="23"
                                    MinWidth="75"/>
                            <telerik:RadButton x:Name="Edit"
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_Edit"
                                    Margin="0 0 5 0"
                                    IsEnabled="{Binding Path=IsSpreadsheetNameSelected}"
                                    Command="{Binding Path=UpdateSpreadsheetName}"
                                    CommandParameter="{Binding Path=SelectedSpreadsheetNameView}"
                                    Height="23"
                                    MinWidth="75"/>
                            <telerik:RadButton x:Name="Delete"
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_Delete"
                                    Margin="0 0 5 0"
                                    IsEnabled="{Binding Path=IsSpreadsheetNameSelected}"
                                    Command="{Binding Path=DeleteSpreadsheetName}"
                                    CommandParameter="{Binding Path=SelectedSpreadsheetNameView}"
                                    Height="23"
                                    MinWidth="75"/>
                        </StackPanel>
                        <grid:RadGridView x:Name="SpreadsheetNamesGridView"
                                Grid.Row="1"
                                ItemsSource="{Binding Path=SpreadsheetNameViews}"
                                SelectedItem="{Binding Path=SelectedSpreadsheetNameView, Mode=TwoWay}"
                                RowIndicatorVisibility="Collapsed"
                                AutoGenerateColumns="False"
                                IsFilteringAllowed="False"
                                CanUserSortColumns="False"
                                CanUserFreezeColumns="False"
                                ShowGroupPanel="False"
                                SelectionUnit="FullRow"
                                VerticalAlignment="Top"
                                Height="285"
                                Margin="0 5">
                            <grid:RadGridView.Columns>
                                <grid:GridViewColumn Width="*">
                                    <grid:GridViewColumn.Header>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_Name"/>
                                    </grid:GridViewColumn.Header>
                                    <grid:GridViewColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/16/defineName.png" Width="16"/>
                                                <TextBlock Text="{Binding Path=Name}" Margin="5 0 0 0"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </grid:GridViewColumn.CellTemplate>
                                </grid:GridViewColumn>
                                <grid:GridViewDataColumn Width="*" DataMemberBinding="{Binding Value}">
                                    <grid:GridViewColumn.Header>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_Value"/>
                                    </grid:GridViewColumn.Header>
                                </grid:GridViewDataColumn>
                                <grid:GridViewDataColumn Width="*" DataMemberBinding="{Binding RefersTo}">
                                    <grid:GridViewColumn.Header>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_RefersTo"/>
                                    </grid:GridViewColumn.Header>
                                </grid:GridViewDataColumn>
                                <grid:GridViewDataColumn Width="*" DataMemberBinding="{Binding ScopeName}">
                                    <grid:GridViewDataColumn.Header>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_Scope"/>
                                    </grid:GridViewDataColumn.Header>
                                </grid:GridViewDataColumn>
                                <grid:GridViewDataColumn Width="*" DataMemberBinding="{Binding Comment}">
                                    <grid:GridViewColumn.Header>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_NameManagerDialog_Comment"/>
                                    </grid:GridViewColumn.Header>
                                </grid:GridViewDataColumn>
                            </grid:RadGridView.Columns>
                        </grid:RadGridView>
                        <telerik:RadButton x:Name="Close"
                                Command="{Binding Path=CloseCommand}"
                                telerik:LocalizationManager.ResourceKey="Close"
                                Grid.Row="2"
                                HorizontalAlignment="Right"
                                Height="23"
                                MinWidth="75"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DataValidationDialogContentStyle" TargetType="dialogs:DataValidationDialogContent">
        <Setter Property="AutomationProperties.AutomationId" Value="dataValidationDialog"/>
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_DataValidationDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Width" Value="390"/>
        <Setter Property="Height" Value="300"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:DataValidationDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" HorizontalAlignment="Stretch">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <telerik:RadTabControl SelectedIndex="{Binding Path=SelectedTabIndex, Mode=TwoWay}" BorderThickness="0 0 0 1">
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_Settings" AutomationProperties.AutomationId="settings">
                                <Grid Margin="8">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_ValidationCriteria"/>
                                        <Border Grid.Column="1" Height="1" Margin="4 2 0 0" Background="{StaticResource LineToTextSeparatorBrush}"/>
                                    </Grid>
                                    <StackPanel Grid.Row="1" Margin="10 5 10 0">
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_Allow" Margin="0 0 0 2"/>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Orientation="Vertical" Grid.Column="1" Margin="5 0 0 0">
                                                <CheckBox
                                                        AutomationProperties.AutomationId="ignoreBlank"
                                                        HorizontalAlignment="Left"
                                                        IsChecked="{Binding Path=IgnoreBlank, Mode=TwoWay}"
                                                        IsEnabled="{Binding Path=IgnoreBlankIsEnabled}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_IgnoreBlank"/>
                                                <CheckBox
                                                        AutomationProperties.AutomationId="inCellDropDown"
                                                        HorizontalAlignment="Left"
                                                        IsChecked="{Binding Path=InCellDropdown, Mode=TwoWay}"
                                                        Visibility="{Binding Path=InCellDropdownVisibility}"
                                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_InCellDropDown"/>
                                            </StackPanel>
                                            <StackPanel>
                                                <telerik:RadComboBox
                                                        AutomationProperties.AutomationId="validationRuleTypes"
                                                        Width="150"
                                                        HorizontalAlignment="Left"
                                                        ItemsSource="{Binding Path=ValidationRuleTypes}"
                                                        SelectedIndex="{Binding Path=SelectedValidationRuleIndex, Mode=TwoWay}"
                                                        Margin="0 0 3 3"/>
                                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_Data" Margin="0 0 0 2"/>
                                                <telerik:RadComboBox
                                                        AutomationProperties.AutomationId="comparisonOperators"
                                                        IsEnabled="{Binding Path=IsComparisonOperatorsEnabled, Mode=TwoWay}"
                                                        HorizontalAlignment="Left"
                                                        Width="150"
                                                        ItemsSource="{Binding Path=ComparisonOperators}"
                                                        SelectedIndex="{Binding Path=SelectedComparisonOperatorIndex, Mode=TwoWay}"
                                                        Margin="0 0 3 3"/>
                                            </StackPanel>
                                        </Grid>
                                        <TextBlock Text="{Binding Path=ArgumentHeader1, Mode=TwoWay}" Visibility="{Binding Path=ArgumentVisibility1}" Margin="0 0 2 0"/>
                                        <TextBox
                                                AutomationProperties.AutomationId="Argument"
                                                HorizontalAlignment="Left"
                                                HorizontalContentAlignment="Stretch"
                                                Width="260"
                                                Visibility="{Binding Path=ArgumentVisibility1}"
                                                Text="{Binding Path=Argument1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                Margin="0 0 3 3"/>
                                        <TextBlock Text="{Binding Path=ArgumentHeader2, Mode=TwoWay}" Visibility="{Binding Path=ArgumentVisibility2}" Margin="0 0 2 0"/>
                                        <TextBox
                                                AutomationProperties.AutomationId="Argument1"
                                                HorizontalAlignment="Left"
                                                HorizontalContentAlignment="Stretch"
                                                Width="260"
                                                Visibility="{Binding Path=ArgumentVisibility2}"
                                                Text="{Binding Path=Argument2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                Margin="0 0 3 3"/>
                                    </StackPanel>
                                    <CheckBox
                                            AutomationProperties.AutomationId="applyChangesToAllCellsWithTheSameSettings"
                                            Grid.Row="3"
                                            IsChecked="{Binding Path=ApplyChangesToAllCellsWithTheSameSettings, Mode=TwoWay}"
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_ApplyChangesToAllCellsWithTheSameSettings"
                                            Margin="0 9 0 0"/>
                                </Grid>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_InputMessage" AutomationProperties.AutomationId="inputMessage">
                                <StackPanel Margin="8">
                                    <CheckBox
                                            AutomationProperties.AutomationId="showInputMessageWhenCellIsSelected"
                                            IsChecked="{Binding Path=ShowInputMessageWhenCellIsSelected, Mode=TwoWay}"
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_ShowInputMessageWhenCellIsSelected"
                                            Margin="0"/>
                                    <Grid Margin="0 10 0 0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_WhenCellIsSelectedShowInputMessage"/>
                                        <Border Grid.Column="1" Height="1" Margin="4 2 0 0" Background="{StaticResource LineToTextSeparatorBrush}"/>
                                    </Grid>
                                    <StackPanel Margin="10 5 10 0">
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_Title" Margin="0 0 0 2"/>
                                        <TextBox
                                                Text="{Binding Path=InputMessageTitle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                IsEnabled="{Binding Path=ShowInputMessageWhenCellIsSelected}"
                                                AutomationProperties.AutomationId="inputMessageTitle"
                                                MaxLength="32"
                                                HorizontalContentAlignment="Stretch"
                                                Margin="0 0 0 3"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_InputMessageLabel" Margin="0 0 0 2"/>
                                        <TextBox
                                                Text="{Binding Path=InputMessageContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                IsEnabled="{Binding Path=ShowInputMessageWhenCellIsSelected}"
                                                AutomationProperties.AutomationId="inputMessageContent"
                                                VerticalScrollBarVisibility="Visible"
                                                MaxLength="255"
                                                TextWrapping="Wrap"
                                                HorizontalContentAlignment="Stretch"
                                                VerticalContentAlignment="Top"
                                                Height="100"/>
                                    </StackPanel>
                                </StackPanel>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_ErrorAlert" AutomationProperties.AutomationId="errorAlert">
                                <telerik:RadTabItem.Resources>
                                    <telerik:IconSources x:Key="IconPaths" LightBasePath="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/" DarkBasePath="/Telerik.Windows.Controls.Spreadsheet;component/Images/Dark/"/>
                                </telerik:RadTabItem.Resources>
                                <StackPanel Margin="8">
                                    <CheckBox
                                            IsChecked="{Binding Path=ShowErrorAlertAfterInvalidDataIsEntered, Mode=TwoWay}"
                                            AutomationProperties.AutomationId="showErrorAlertAfterInvalidDataIsEntered"
                                            telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_ShowErrorAlertAfterInvalidDataIsEntered"
                                            Margin="0"/>
                                    <Grid Margin="0 10 0 0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_WhenUserEntersInvalidDataShowThisErrorAlert"/>
                                        <Border Grid.Column="1" Height="1" Margin="4 2 0 0" Background="{StaticResource LineToTextSeparatorBrush}"/>
                                    </Grid>
                                    <Grid Margin="10 5 10 0">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="10"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <StackPanel>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_Style" Margin="0 0 0 2"/>
                                            <telerik:RadComboBox
                                                    AutomationProperties.AutomationId="errorAlertStyles"
                                                    ItemsSource="{Binding Path=ErrorAlertStyles}"
                                                    SelectedIndex="{Binding Path=SelectedErrorStyleIndex, Mode=TwoWay}"
                                                    IsEnabled="{Binding Path=ShowErrorAlertAfterInvalidDataIsEntered}"/>
                                        </StackPanel>
                                        <Image
                                                Source="{telerik:IconResource IconRelativePath=32/stop.png, IconSources={StaticResource IconPaths}}"
                                                Visibility="{Binding Path=StopImageVisibility}"
                                                Grid.Row="1"
                                                Grid.Column="0"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                Stretch="None"/>
                                        <Image
                                                Source="{telerik:IconResource IconRelativePath=32/warning.png, IconSources={StaticResource IconPaths}}"
                                                Visibility="{Binding Path=WarningImageVisibility}"
                                                Grid.Row="1"
                                                Grid.Column="0"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                Stretch="None"/>
                                        <Image
                                                Source="{telerik:IconResource IconRelativePath=32/information.png, IconSources={StaticResource IconPaths}}"
                                                Visibility="{Binding Path=InformationImageVisibility}"
                                                Grid.Row="1"
                                                Grid.Column="0"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                Stretch="None"/>
                                        <StackPanel Grid.Column="2">
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_Title" Margin="0 0 0 2"/>
                                            <TextBox
                                                    Text="{Binding Path=ErrorAlertTitle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                    AutomationProperties.AutomationId="errorAlertTitle"
                                                    MaxLength="32"
                                                    HorizontalContentAlignment="Stretch"
                                                    IsEnabled="{Binding Path=ShowErrorAlertAfterInvalidDataIsEntered}"
                                                    Margin="0 0 0 3"/>
                                        </StackPanel>
                                        <StackPanel Grid.Row="1" Grid.Column="2">
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_DataValidationDialog_ErrorMessage" Margin="0 0 0 2"/>
                                            <TextBox
                                                    Text="{Binding Path=ErrorAlertContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                    AutomationProperties.AutomationId="errorAlertContent"
                                                    VerticalScrollBarVisibility="Visible"
                                                    TextWrapping="Wrap"
                                                    MaxLength="235"
                                                    Height="100"
                                                    VerticalContentAlignment="Top"
                                                    HorizontalContentAlignment="Stretch"
                                                    IsEnabled="{Binding Path=ShowErrorAlertAfterInvalidDataIsEntered}"/>
                                        </StackPanel>
                                    </Grid>
                                </StackPanel>
                            </telerik:RadTabItem>
                        </telerik:RadTabControl>
                        <Grid Grid.Row="1" Margin="8">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton x:Name="PART_ButtonClearAll"
                                    Command="{Binding Path=ClearAllCommand}"
                                    Grid.Column="0"
                                    telerik:LocalizationManager.ResourceKey="ClearAll"
                                    VerticalAlignment="Center"
                                    MinWidth="75"/>
                            <StackPanel Orientation="Horizontal" Grid.Column="2">
                                <telerik:RadButton x:Name="PART_ButtonOK" Command="{Binding Path=OkCommand}" telerik:LocalizationManager.ResourceKey="Ok" VerticalAlignment="Center" MinWidth="75"/>
                                <telerik:RadButton x:Name="PART_ButtonCancel"
                                        Command="{Binding Path=CloseCommand}"
                                        telerik:LocalizationManager.ResourceKey="Cancel"
                                        VerticalAlignment="Center"
                                        MinWidth="75"
                                        Margin="8 0 0 0"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <DataTemplate x:Key="AlertIconTemplate">
        <Grid Height="44" Width="46">
            <Path
                    Stretch="Fill"
                    Margin="-23 0 0 0"
                    RenderTransformOrigin="0.75 0.5"
                    Data="M24.1,0 C24.9,0.3 25.4,1.4 25.4,1.4 C25.4,1.4 46.1,38.3 46.1,40.9 C46.1,43.4 43.7,43.7 43.7,43.7 L23,43.7 L2.4,43.7 C2.4,43.7 0,43.4 0,40.9 C0,38.3 20.8,1.4 20.8,1.4 C20.8,1.4 21.2,0.3 22,0 z"
                    HorizontalAlignment="Left"
                    Width="46">
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.4 1" StartPoint="0.6 0">
                        <GradientStop Color="#FFFFDA45" Offset="0.3"/>
                        <GradientStop Color="#FFFF9945" Offset="1"/>
                    </LinearGradientBrush>
                </Path.Fill>
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="-1"/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
            <Path
                    Stretch="Fill"
                    Margin="-23 18 0 0"
                    RenderTransformOrigin="0.75 0.5"
                    Data="M44.9,37.7 C45.7,39.3 46.1,40.5 46.1,40.9 C46.1,43.4 43.7,43.7 43.7,43.7 L23,43.7 L2.4,43.7 C2.4,43.7 0,43.4 0,40.9 C0,39.5 5.8,28.6 11.4,18.3 C11.5,18 44.6,37.1 44.9,37.7 z"
                    HorizontalAlignment="Left"
                    Width="46">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="-1"/>
                    </TransformGroup>
                </Path.RenderTransform>
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.4 1" StartPoint="0.5 0.4">
                        <GradientStop Color="#FFFCB827" Offset="0.7"/>
                        <GradientStop Color="#FFFE9A0A" Offset="0.1"/>
                    </LinearGradientBrush>
                </Path.Fill>
            </Path>
            <Path
                    Stretch="Fill"
                    Margin="-22 1 0 0"
                    RenderTransformOrigin="0.75 0.5"
                    Data="M24.1,0 C24.9,0.3 25.4,1.4 25.4,1.4 C25.4,1.4 46.1,38.3 46.1,40.9 C46.1,43.4 43.7,43.7 43.7,43.7 L23,43.7 L2.4,43.7 C2.4,43.7 0,43.4 0,40.9 C0,38.3 20.8,1.4 20.8,1.4 C20.8,1.4 21.2,0.3 22,0 z"
                    Stroke="#FFFEF065"
                    HorizontalAlignment="Left"
                    Width="44">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="-1"/>
                        <TranslateTransform X="1"/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
            <Path
                    Stretch="Fill"
                    Height="17"
                    Margin="6 0 6 1"
                    VerticalAlignment="Bottom"
                    Data="M179.6,132.9 L209.1,132.9 C209.1,132.9 207,119.5 194.2,119.5 C182.5,119.5 179.6,132.9 179.6,132.9 z">
                <Path.OpacityMask>
                    <RadialGradientBrush GradientOrigin="0.5 0.9">
                        <GradientStop Color="#A8FFD100" Offset="0.4"/>
                        <GradientStop Color="Transparent" Offset="0.9"/>
                        <GradientStop Color="#A0DCA209" Offset="0.2"/>
                    </RadialGradientBrush>
                </Path.OpacityMask>
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.5 1" StartPoint="0.5 0">
                        <GradientStop Color="#24FEF9BA" Offset="1"/>
                        <GradientStop Color="#BBFBFC18" Offset="0.9"/>
                        <GradientStop Color="#48FED72C" Offset="0.3"/>
                    </LinearGradientBrush>
                </Path.Fill>
            </Path>
            <Path
                    Stretch="Fill"
                    Margin="-23 0 0 0"
                    RenderTransformOrigin="0.75 0.5"
                    Data="M24.1,0 C24.9,0.3 25.4,1.4 25.4,1.4 C25.4,1.4 46.1,38.3 46.1,40.9 C46.1,43.4 43.7,43.7 43.7,43.7 L23,43.7 L2.4,43.7 C2.4,43.7 0,43.4 0,40.9 C0,38.3 20.8,1.4 20.8,1.4 C20.8,1.4 21.2,0.3 22,0 z"
                    HorizontalAlignment="Left"
                    Width="46">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="-1"/>
                    </TransformGroup>
                </Path.RenderTransform>
                <Path.Stroke>
                    <LinearGradientBrush EndPoint="0.5 1" StartPoint="0.5 0">
                        <GradientStop Color="#FFF66E04" Offset="0"/>
                        <GradientStop Color="#FFC35602" Offset="1"/>
                    </LinearGradientBrush>
                </Path.Stroke>
            </Path>
            <Path
                    Stretch="Fill"
                    Margin="20 13 0 15"
                    Data="M118.2,79.4 C118.2,79.4 118.8,78.4 119.2,78.4 C119.5,78.3 121.2,78.4 121.2,78.4 C121.2,78.4 121.9,79.1 122,79.2 C122,79.4 122,91.2 122,91.2 L121.1,92.7 L119.1,92.7 L118.2,91.2 z"
                    Fill="White"
                    HorizontalAlignment="Left"
                    Width="5"/>
            <Ellipse Fill="White" Height="6" Margin="19 0 0 5" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="6"/>
        </Grid>
    </DataTemplate>
    <Style x:Key="AlertDialogContentStyle" TargetType="dialogs:AlertDialogContent">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="MinWidth" Value="275"/>
        <Setter Property="MaxWidth" Value="500"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:AlertDialogContent">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter x:Name="Icon" VerticalAlignment="Top" ContentTemplate="{StaticResource AlertIconTemplate}" Margin="16 8 8 8"/>
                        <TextBlock x:Name="AlertText" Text="{Binding Path=Content}" TextWrapping="Wrap" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Margin="8 8 8 8"/>
                        <Border x:Name="HorizontalRule"
                                Grid.Row="1"
                                Grid.ColumnSpan="2"
                                VerticalAlignment="Top"
                                Height="2"
                                BorderThickness="0 0 0 1"
                                Background="{StaticResource BorderLineOuterColor}"
                                BorderBrush="{StaticResource BorderLineInnerColor}"/>
                        <telerik:RadButton
                                Command="{Binding Path=OkCommand}"
                                AutomationProperties.AutomationId="OK"
                                Grid.Row="1"
                                Grid.ColumnSpan="2"
                                MinWidth="70"
                                IsTabStop="True"
                                TabIndex="0"
                                HorizontalAlignment="Right"
                                telerik:LocalizationManager.ResourceKey="Ok"
                                Margin="0 10 8 8"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <DataTemplate x:Key="ConfirmIconTemplate">
        <Grid Height="44" Width="44">
            <Ellipse Width="44">
                <Ellipse.Fill>
                    <LinearGradientBrush EndPoint="0.7 1" StartPoint="0.3 0">
                        <GradientStop Color="#FF67A1F4" Offset="0.1"/>
                        <GradientStop Color="#FF1660C0" Offset="0.7"/>
                    </LinearGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
            <Path Stretch="Fill" Margin="2 16 1 0" Data="M289,92.6 C289,92.6 299.3,80.5 329.4,81 C329.8,81 332.6,107.1 308.8,107.1 C296,107.1 289,92.6 289,92.6 z">
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.6 1" StartPoint="0.4 0">
                        <GradientStop Color="#FF1660C0" Offset="0"/>
                        <GradientStop Color="#FF084EAB" Offset="1"/>
                    </LinearGradientBrush>
                </Path.Fill>
            </Path>
            <Ellipse Stroke="#FF9AC2FA" Margin="1 1 0 0">
                <Ellipse.OpacityMask>
                    <LinearGradientBrush EndPoint="0.5 1" StartPoint="0.5 0">
                        <GradientStop Color="#7C1D99EC" Offset="0"/>
                        <GradientStop Color="#7EAFDDFC" Offset="1"/>
                        <GradientStop Color="#C45EB6F1" Offset="0.4"/>
                    </LinearGradientBrush>
                </Ellipse.OpacityMask>
            </Ellipse>
            <Path
                    Stretch="Fill"
                    Margin="13 6 12 15"
                    Data="M300.1,72.5 L300.2,76.8 C300.2,76.8 303.7,74.2 308.5,75 C312.6,75.7 312.3,80.3 311.2,81.9 C307.6,87.3 306,88 306,89.6 C306,91.5 306,92.9 306,92.9 L311.4,92.9 L311.4,89.7 C311.4,89.7 312.4,89 315.2,85.8 C316.8,83.9 318,81.9 318.4,80.7 C319,79.1 319.7,74.5 315,72.1 C313.4,71.3 311.4,70.4 307.1,70.6 C302.8,70.7 300.1,72.5 300.1,72.5 z"
                    Fill="White"/>
            <Rectangle Fill="White" Height="6" Margin="19 0 19 6" VerticalAlignment="Bottom"/>
            <Ellipse Width="44">
                <Ellipse.Stroke>
                    <LinearGradientBrush EndPoint="0.5 1" StartPoint="0.5 0">
                        <GradientStop Color="#FF2F6FC4" Offset="0"/>
                        <GradientStop Color="#FF084FAB" Offset="1"/>
                    </LinearGradientBrush>
                </Ellipse.Stroke>
            </Ellipse>
        </Grid>
    </DataTemplate>
    <Style x:Key="ConfirmDialogContentStyle" TargetType="dialogs:ConfirmDialogContent">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="MinWidth" Value="275"/>
        <Setter Property="MaxWidth" Value="500"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:ConfirmDialogContent">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter x:Name="Icon" VerticalAlignment="Top" ContentTemplate="{StaticResource ConfirmIconTemplate}" Margin="16 8 8 8"/>
                        <TextBlock x:Name="ConfirmText" Text="{Binding Path=Content}" TextWrapping="Wrap" Margin="8 8 8 8" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
                        <Border x:Name="HorizontalRule"
                                Grid.Row="1"
                                Grid.ColumnSpan="2"
                                VerticalAlignment="Top"
                                Height="2"
                                BorderThickness="0 0 0 1"
                                Background="{StaticResource BorderLineOuterColor}"
                                BorderBrush="{StaticResource BorderLineInnerColor}"/>
                        <StackPanel x:Name="DialogButtons" Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                            <telerik:RadButton x:Name="OK"
                                    AutomationProperties.AutomationId="OK"
                                    Command="{Binding Path=OkCommand}"
                                    MinWidth="70"
                                    IsTabStop="True"
                                    TabIndex="0"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Ok"
                                    Margin="0 10 8 8"/>
                            <telerik:RadButton
                                    AutomationProperties.AutomationId="Cancel"
                                    MinWidth="70"
                                    Command="{Binding Path=CancelCommand}"
                                    IsTabStop="True"
                                    TabIndex="1"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Cancel"
                                    Margin="0 10 8 8"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="StopDialogContentStyle" TargetType="dialogs:StopDialogContent">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="MinWidth" Value="275"/>
        <Setter Property="MaxWidth" Value="500"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:StopDialogContent">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter VerticalAlignment="Top" Margin="16 8 8 8">
                            <ContentPresenter.ContentTemplate>
                                <DataTemplate>
                                    <Image Width="32" Height="32" Source="{telerik:IconResource IconRelativePath=32/stop.png, IconSources={StaticResource IconPaths}}"/>
                                </DataTemplate>
                            </ContentPresenter.ContentTemplate>
                        </ContentPresenter>
                        <TextBlock Text="{Binding Path=Content}" TextWrapping="Wrap" Margin="8 8 8 8" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
                        <Border x:Name="HorizontalRule"
                                Grid.Row="1"
                                Grid.ColumnSpan="2"
                                VerticalAlignment="Top"
                                Height="2"
                                BorderThickness="0 0 0 1"
                                Background="{StaticResource BorderLineOuterColor}"
                                BorderBrush="{StaticResource BorderLineInnerColor}"/>
                        <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                            <telerik:RadButton x:Name="OK"
                                    AutomationProperties.AutomationId="Retry"
                                    Command="{Binding Path=OkCommand}"
                                    MinWidth="70"
                                    IsTabStop="True"
                                    TabIndex="0"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Retry"
                                    Margin="0 10 8 8"/>
                            <telerik:RadButton
                                    AutomationProperties.AutomationId="Cancel"
                                    MinWidth="70"
                                    Command="{Binding Path=CancelCommand}"
                                    IsTabStop="True"
                                    TabIndex="1"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Cancel"
                                    Margin="0 10 8 8"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="WarningDialogContentStyle" TargetType="dialogs:WarningDialogContent">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="MinWidth" Value="275"/>
        <Setter Property="MaxWidth" Value="500"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:WarningDialogContent">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter VerticalAlignment="Top" Margin="16 8 8 8">
                            <ContentPresenter.ContentTemplate>
                                <DataTemplate>
                                    <Image Width="32" Height="32" Source="{telerik:IconResource IconRelativePath=32/warning.png, IconSources={StaticResource IconPaths}}"/>
                                </DataTemplate>
                            </ContentPresenter.ContentTemplate>
                        </ContentPresenter>
                        <TextBlock Text="{Binding Path=Content}" TextWrapping="Wrap" Margin="8 8 8 8" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
                        <Border x:Name="HorizontalRule"
                                Grid.Row="1"
                                Grid.ColumnSpan="2"
                                VerticalAlignment="Top"
                                Height="2"
                                BorderThickness="0 0 0 1"
                                Background="{StaticResource BorderLineOuterColor}"
                                BorderBrush="{StaticResource BorderLineInnerColor}"/>
                        <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                            <telerik:RadButton
                                    AutomationProperties.AutomationId="Yes"
                                    Command="{Binding Path=OkCommand}"
                                    MinWidth="70"
                                    IsTabStop="True"
                                    TabIndex="0"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Yes"
                                    Margin="0 10 8 8"/>
                            <telerik:RadButton x:Name="No"
                                    AutomationProperties.AutomationId="No"
                                    Command="{Binding Path=NoCommand}"
                                    MinWidth="70"
                                    IsTabStop="True"
                                    TabIndex="0"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="No"
                                    Margin="0 10 8 8"/>
                            <telerik:RadButton
                                    AutomationProperties.AutomationId="Cancel"
                                    MinWidth="70"
                                    Command="{Binding Path=CancelCommand}"
                                    IsTabStop="True"
                                    TabIndex="1"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Cancel"
                                    Margin="0 10 8 8"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="InformationDialogContentStyle" TargetType="dialogs:InformationDialogContent">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="MinWidth" Value="275"/>
        <Setter Property="MaxWidth" Value="500"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:InformationDialogContent">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter VerticalAlignment="Top" Margin="16 8 8 8">
                            <ContentPresenter.ContentTemplate>
                                <DataTemplate>
                                    <Image Width="32" Height="32" Source="{telerik:IconResource IconRelativePath=32/information.png, IconSources={StaticResource IconPaths}}"/>
                                </DataTemplate>
                            </ContentPresenter.ContentTemplate>
                        </ContentPresenter>
                        <TextBlock Text="{Binding Path=Content}" TextWrapping="Wrap" Margin="8 8 8 8" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
                        <Border x:Name="HorizontalRule"
                                Grid.Row="1"
                                Grid.ColumnSpan="2"
                                VerticalAlignment="Top"
                                Height="2"
                                BorderThickness="0 0 0 1"
                                Background="{StaticResource BorderLineOuterColor}"
                                BorderBrush="{StaticResource BorderLineInnerColor}"/>
                        <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
                            <telerik:RadButton x:Name="OK"
                                    AutomationProperties.AutomationId="OK"
                                    Command="{Binding Path=OkCommand}"
                                    MinWidth="70"
                                    IsTabStop="True"
                                    TabIndex="0"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Ok"
                                    Margin="0 10 8 8"/>
                            <telerik:RadButton
                                    AutomationProperties.AutomationId="Cancel"
                                    MinWidth="70"
                                    Command="{Binding Path=CancelCommand}"
                                    IsTabStop="True"
                                    TabIndex="1"
                                    HorizontalAlignment="Right"
                                    telerik:LocalizationManager.ResourceKey="Cancel"
                                    Margin="0 10 8 8"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CreateUpdateSpreadsheetNameDialogContentStyle" TargetType="dialogs:CreateUpdateSpreadsheetNameDialogContent">
        <Setter Property="Header" Value="{Binding Path=DialogHeader}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Width" Value="300"/>
        <Setter Property="Height" Value="200"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CreateUpdateSpreadsheetNameDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateUpdateSpreadsheetNameDialog_Name" Margin="0 5" IsTabStop="False"/>
                            <TextBox x:Name="Name" Text="{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="1" Margin="5 5 0 5"/>
                            <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateUpdateSpreadsheetNameDialog_Scope" Grid.Row="1" Grid.Column="0" Margin="0 5" IsTabStop="False"/>
                            <telerik:RadComboBox x:Name="Scope"
                                    ItemsSource="{Binding Path=Scopes}"
                                    SelectedItem="{Binding Path=SelectedScope, Mode=TwoWay}"
                                    IsEnabled="{Binding Path=CanChangeScope}"
                                    Margin="5 5 0 5"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    MinWidth="120"
                                    HorizontalAlignment="Left">
                                <telerik:RadComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Mode=OneWay, Converter={StaticResource NameScopeToStringConverter}}"/>
                                    </DataTemplate>
                                </telerik:RadComboBox.ItemTemplate>
                            </telerik:RadComboBox>
                            <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateUpdateSpreadsheetNameDialog_Comment" Grid.Row="2" Grid.Column="0" Margin="0 5" IsTabStop="False"/>
                            <TextBox x:Name="Comment"
                                    Text="{Binding Path=Comment, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                    Grid.Row="2"
                                    Grid.Column="1"
                                    Margin="5 5 0 5"
                                    TextWrapping="Wrap"
                                    VerticalContentAlignment="Top"
                                    VerticalScrollBarVisibility="Visible"/>
                            <telerik:Label telerik:LocalizationManager.ResourceKey="Spreadsheet_CreateUpdateSpreadsheetNameDialog_RefersTo" IsTabStop="False" Grid.Row="3" Grid.Column="0" Margin="0 5"/>
                            <TextBox x:Name="RefersTo" Text="{Binding Path=RefersTo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" Grid.Column="1" Margin="5 5 0 5"/>
                        </Grid>
                        <StackPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">
                            <telerik:RadButton x:Name="Ok" Command="{Binding Path=OkCommand}" telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                            <telerik:RadButton x:Name="Cancel" Command="{Binding Path=CloseCommand}" telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ProtectDialogContentStyle" TargetType="dialogs:ProtectDialogContent">
        <Setter Property="Header" Value="{Binding Path=DialogHeader}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Width" Value="300"/>
        <Setter Property="Foreground" Value="{StaticResource ControlElement_Normal}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:ProtectDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_ProtectDialog_Password" Margin="0 5 0 0" VerticalAlignment="Center"/>
                        <PasswordBox Grid.Column="1" dialogs:PasswordHelper.Password="{Binding ProtectionPassword, Mode=TwoWay}" Margin="5 5 0 0" Height="23"/>
                        <TextBlock Grid.Row="1" telerik:LocalizationManager.ResourceKey="Spreadsheet_ProtectDialog_RepeatPassword" Margin="0 5 0 0" VerticalAlignment="Center"/>
                        <PasswordBox Grid.Row="1" Grid.Column="1" dialogs:PasswordHelper.Password="{Binding ProtectionRepeatPassword, Mode=TwoWay}" Margin="5 5 0 0" Height="23"/>
                        <TextBlock
                                Grid.ColumnSpan="2"
                                Grid.Row="2"
                                Margin="0 10 0 0"
                                telerik:LocalizationManager.ResourceKey="Spreadsheet_ProtectDialog_AllowUsersTo"
                                Visibility="{Binding HasProtectionOptions, Converter={StaticResource BoolToVisibilityValueConverter}}"/>
                        <ItemsControl Grid.ColumnSpan="2" Grid.Row="3" ItemsSource="{Binding ProtectionOptions}" Margin="0 5 0 0">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <CheckBox IsChecked="{Binding Value, Mode=TwoWay}" Content="{Binding Title, Mode=OneWay}"/>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <StackPanel Grid.ColumnSpan="2" Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">
                            <telerik:RadButton x:Name="Ok"
                                    Command="{Binding Path=OkCommand}"
                                    CommandParameter="{Binding ElementName=passwordBox}"
                                    telerik:LocalizationManager.ResourceKey="Ok"
                                    Height="23"
                                    MinWidth="75"
                                    Margin="10 5 0 5"/>
                            <telerik:RadButton x:Name="Cancel" Command="{Binding Path=CloseCommand}" telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="UnprotectDialogContentStyle" TargetType="dialogs:UnprotectDialogContent">
        <Setter Property="Header" Value="{Binding Path=DialogHeader}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Width" Value="300"/>
        <Setter Property="Height" Value="100"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:UnprotectDialogContent">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Margin="0 0 5 0" telerik:LocalizationManager.ResourceKey="Spreadsheet_UnprotectDialog_Password" VerticalAlignment="Center"/>
                        <PasswordBox
                                Grid.Column="1"
                                HorizontalAlignment="Stretch"
                                dialogs:PasswordHelper.Password="{Binding ProtectionPassword, Mode=TwoWay}"
                                VerticalAlignment="Center"
                                Margin="0 5 0 0"
                                Height="23"/>
                        <StackPanel Grid.ColumnSpan="2" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">
                            <telerik:RadButton x:Name="Ok"
                                    Command="{Binding Path=OkCommand}"
                                    CommandParameter="{Binding ElementName=passwordBox}"
                                    telerik:LocalizationManager.ResourceKey="Ok"
                                    Height="23"
                                    MinWidth="75"
                                    Margin="10 5 0 5"/>
                            <telerik:RadButton x:Name="Cancel" Command="{Binding Path=CloseCommand}" telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FormatFontDialogContentStyle" TargetType="dialogs:FormatFontDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_FormatCellsDialog_Font_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="MaxWidth" Value="750"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:FormatFontDialogContent">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="205*"/>
                            <RowDefinition Height="40"/>
                        </Grid.RowDefinitions>
                        <dialogs:FontTabContent x:Name="PART_FontTabContent"/>
                        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" Command="{Binding OKCommand}"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5" Command="{Binding CloseCommand}"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HeaderFooterDialogTabContentStyle" TargetType="dialogs:HeaderFooterDialogTabContent">
        <Setter Property="Height" Value="300"/>
        <Setter Property="Width" Value="600"/>
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:HeaderFooterDialogTabContent">
                    <Grid Margin="{TemplateBinding Padding}">
                        <Grid.Resources>
                            <Style TargetType="{x:Type Paragraph}">
                                <Setter Property="Margin" Value="0"/>
                            </Style>
                        </Grid.Resources>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.ColumnSpan="3">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_ToFormatText" TextWrapping="Wrap" Margin="0 10 0 0" HorizontalAlignment="Left"/>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_ToInsertField" TextWrapping="Wrap" Margin="0 10 0 0" HorizontalAlignment="Left"/>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
                                <telerik:RadButton Command="{Binding Path=FormatTextCommand}" IsTabStop="False" Background="{StaticResource DialogsBackgroundBrush}" Focusable="False" Width="27" Height="27" Margin="1">
                                    <telerik:RadButton.ToolTip>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_FormatText"/>
                                    </telerik:RadButton.ToolTip>
                                    <Image
                                            Stretch="None"
                                            Width="16"
                                            Source="{telerik:IconResource IconRelativePath=Printing/16/formatText.png, IconSources={StaticResource IconPaths}}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                </telerik:RadButton>
                                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                                    <telerik:RadButton
                                            Command="{Binding Path=InsertPageNumberCommand}"
                                            IsTabStop="False"
                                            Background="{StaticResource DialogsBackgroundBrush}"
                                            Focusable="False"
                                            Width="27"
                                            Height="27"
                                            Margin="1">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_InsertPageNumber"/>
                                        </telerik:RadButton.ToolTip>
                                        <Image
                                                Stretch="None"
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=Printing/16/insertPageNumber.png, IconSources={StaticResource IconPaths}}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                    </telerik:RadButton>
                                    <telerik:RadButton
                                            Command="{Binding Path=InsertNumberOfPagesCommand}"
                                            IsTabStop="False"
                                            Background="{StaticResource DialogsBackgroundBrush}"
                                            Focusable="False"
                                            Width="27"
                                            Height="27"
                                            Margin="1">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_InsertNumberOfPages"/>
                                        </telerik:RadButton.ToolTip>
                                        <Image
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=Printing/16/insertNumberOfPages.png, IconSources={StaticResource IconPaths}}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                    </telerik:RadButton>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                                    <telerik:RadButton Command="{Binding Path=InsertDateCommand}" IsTabStop="False" Background="{StaticResource DialogsBackgroundBrush}" Focusable="False" Width="27" Height="27" Margin="1">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_InsertDate"/>
                                        </telerik:RadButton.ToolTip>
                                        <Image
                                                Stretch="None"
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=Printing/16/addDate.png, IconSources={StaticResource IconPaths}}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                    </telerik:RadButton>
                                    <telerik:RadButton Command="{Binding Path=InsertTimeCommand}" IsTabStop="False" Background="{StaticResource DialogsBackgroundBrush}" Focusable="False" Width="27" Height="27" Margin="1">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_InsertTime"/>
                                        </telerik:RadButton.ToolTip>
                                        <Image
                                                Stretch="None"
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=Printing/16/addTime.png, IconSources={StaticResource IconPaths}}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                    </telerik:RadButton>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                                    <telerik:RadButton
                                            Command="{Binding Path=InsertFilePathCommand}"
                                            IsTabStop="False"
                                            Background="{StaticResource DialogsBackgroundBrush}"
                                            Focusable="False"
                                            Width="27"
                                            Height="27"
                                            Margin="1">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_InsertFilePath"/>
                                        </telerik:RadButton.ToolTip>
                                        <Image
                                                Stretch="None"
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=Printing/16/insertFilePath.png, IconSources={StaticResource IconPaths}}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                    </telerik:RadButton>
                                    <telerik:RadButton
                                            Command="{Binding Path=InsertFileNameCommand}"
                                            IsTabStop="False"
                                            Background="{StaticResource DialogsBackgroundBrush}"
                                            Focusable="False"
                                            Width="27"
                                            Height="27"
                                            Margin="1">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_InsertFileName"/>
                                        </telerik:RadButton.ToolTip>
                                        <Image
                                                Stretch="None"
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=Printing/16/insertFileName.png, IconSources={StaticResource IconPaths}}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                    </telerik:RadButton>
                                    <telerik:RadButton
                                            Command="{Binding Path=InsertSheetNameCommand}"
                                            IsTabStop="False"
                                            Background="{StaticResource DialogsBackgroundBrush}"
                                            Focusable="False"
                                            Width="27"
                                            Height="27"
                                            Margin="1">
                                        <telerik:RadButton.ToolTip>
                                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_InsertSheetName"/>
                                        </telerik:RadButton.ToolTip>
                                        <Image
                                                Stretch="None"
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=Printing/16/insertSheetName.png, IconSources={StaticResource IconPaths}}"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                RenderOptions.BitmapScalingMode="NearestNeighbor"/>
                                    </telerik:RadButton>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <TextBlock Grid.Row="1" Grid.Column="0" telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_LeftSection" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="1" Grid.Column="1" telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_CenterSection" HorizontalAlignment="Left"/>
                        <TextBlock Grid.Row="1" Grid.Column="2" telerik:LocalizationManager.ResourceKey="Spreadsheet_HeaderFooterDialog_RightSection" HorizontalAlignment="Left"/>
                        <RichTextBox Grid.Row="2" Grid.Column="0" x:Name="PART_LeftSectionBox" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible"/>
                        <RichTextBox Grid.Row="2" Grid.Column="1" x:Name="PART_CenterSectionBox" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible"/>
                        <RichTextBox Grid.Row="2" Grid.Column="2" x:Name="PART_RightSectionBox" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HeaderFooterDialogContentStyle" TargetType="dialogs:HeaderFooterDialogContent">
        <Setter Property="Header" Value="{Binding DialogHeader}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:HeaderFooterDialogContent">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="205*"/>
                            <RowDefinition Height="40"/>
                        </Grid.RowDefinitions>
                        <telerik:RadTabControl x:Name="TabControl" Margin="-1 0">
                            <telerik:RadTabItem
                                    Header="{Binding TabHeader}"
                                    Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibilityValueConverter}}"
                                    DataContext="{Binding FirstPageContent}"
                                    MinWidth="55"
                                    IsSelected="{Binding IsSelected}">
                                <dialogs:HeaderFooterDialogTabContent/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem
                                    Header="{Binding TabHeader}"
                                    Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibilityValueConverter}}"
                                    DataContext="{Binding DefaultContent}"
                                    MinWidth="55"
                                    IsSelected="{Binding IsSelected}">
                                <dialogs:HeaderFooterDialogTabContent/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem
                                    Header="{Binding TabHeader}"
                                    Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibilityValueConverter}}"
                                    DataContext="{Binding EvenPageContent}"
                                    MinWidth="55"
                                    IsSelected="{Binding IsSelected}">
                                <dialogs:HeaderFooterDialogTabContent/>
                            </telerik:RadTabItem>
                        </telerik:RadTabControl>
                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" Command="{Binding OKCommand}" Grid.Column="1"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5" Command="{Binding CloseCommand}" Grid.Column="2"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="PageTabContentStyle" TargetType="dialogs:PageTabContent">
        <Setter Property="Height" Value="400"/>
        <Setter Property="Width" Value="400"/>
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:PageTabContent">
                    <Grid Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Orientation" Margin="0 10 0 0" HorizontalAlignment="Left"/>
                            <Border Grid.Column="1" Margin="2 12 0 0" Height="1" Background="{StaticResource LineToTextSeparatorBrush}"/>
                        </Grid>
                        <StackPanel Orientation="Horizontal" Margin="0 5 0 0" Grid.Row="1">
                            <Image Source="{telerik:IconResource IconRelativePath=Printing/portrait.png, IconSources={StaticResource IconPaths}}" Stretch="None" Margin="5 0" UseLayoutRounding="True"/>
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Portrait"
                                    GroupName="PortraitOption"
                                    IsChecked="{Binding Path=Orientation, Converter={StaticResource PageOrientationToBooleanConverter}, ConverterParameter=Portrait, Mode=TwoWay}"
                                    Margin="5 3 0 0"/>
                            <Image
                                    Source="{telerik:IconResource IconRelativePath=Printing/landscape.png, IconSources={StaticResource IconPaths}}"
                                    Stretch="None"
                                    Margin="10 0 5 0"
                                    UseLayoutRounding="True"/>
                            <RadioButton
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Landscape"
                                    GroupName="LandscapeOption"
                                    IsChecked="{Binding Path=Orientation, Converter={StaticResource PageOrientationToBooleanConverter}, ConverterParameter=Landscape, Mode=TwoWay}"
                                    Margin="5 3 0 0"/>
                        </StackPanel>
                        <Grid Grid.Row="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Scaling" Margin="0 10 0 0" HorizontalAlignment="Left"/>
                            <Border Grid.Column="1" Margin="2 12 0 0" Height="1" Background="{StaticResource LineToTextSeparatorBrush}"/>
                        </Grid>
                        <ContentControl IsEnabled="{Binding IsScalingEnabled}" Margin="0 5 0 0" Grid.Row="3" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                            <Grid HorizontalAlignment="Left">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <RadioButton
                                        telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_AdjustTo"
                                        GroupName="AdjustToOption"
                                        IsChecked="{Binding Path=ScalingMethod, Converter={StaticResource ScalingMethodToBooleanConverter}, ConverterParameter=AdjustTo, Mode=TwoWay}"
                                        Margin="0 3 0 0"/>
                                <telerik:RadNumericUpDown
                                        Value="{Binding Path=ScaleFactorPercent, Mode=TwoWay}"
                                        IsInteger="True"
                                        Margin="5 0"
                                        Grid.Column="1"
                                        Minimum="{Binding ScaleFactorPercentMinimum}"
                                        Maximum="{Binding ScaleFactorPercentMaximum}"
                                        SmallChange="5"
                                        HorizontalAlignment="Left"
                                        Width="57"/>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_PercentNormalSize" VerticalAlignment="Center" Grid.Column="2"/>
                            </Grid>
                        </ContentControl>
                        <StackPanel Margin="0 10 0 0" Grid.Row="4">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Column="0" telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_PaperSize" VerticalAlignment="Center"/>
                                <telerik:RadComboBox Grid.Column="1" ItemsSource="{Binding Path=PaperTypes}" Margin="5 0" SelectedItem="{Binding Path=SelectedPaperType, Mode=TwoWay}"/>
                            </Grid>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="MarginsTabContentStyle" TargetType="dialogs:MarginsTabContent">
        <Setter Property="Height" Value="400"/>
        <Setter Property="Width" Value="400"/>
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:MarginsTabContent">
                    <Grid Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="148"/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="148"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="3" HorizontalAlignment="Center">
                                    <StackPanel>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Top"/>
                                        <telerik:RadNumericUpDown Value="{Binding Path=Top, Mode=TwoWay}" Minimum="0" SmallChange="{Binding SmallChange}" Width="57"/>
                                    </StackPanel>
                                    <StackPanel Margin="5 0 0 0">
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Header"/>
                                        <telerik:RadNumericUpDown Value="{Binding Path=Header, Mode=TwoWay}" Minimum="0" SmallChange="{Binding SmallChange}" Width="57"/>
                                    </StackPanel>
                                </StackPanel>
                                <StackPanel Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Left"/>
                                    <telerik:RadNumericUpDown Value="{Binding Path=Left, Mode=TwoWay}" Minimum="0" SmallChange="{Binding SmallChange}" Width="57"/>
                                </StackPanel>
                                <Image
                                        Grid.Row="1"
                                        Grid.Column="1"
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Source="{Binding MarginsImage, Mode=OneWay}"
                                        Stretch="None"
                                        UseLayoutRounding="True"
                                        Margin="10"/>
                                <StackPanel Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Right"/>
                                    <telerik:RadNumericUpDown Value="{Binding Path=Right, Mode=TwoWay}" Minimum="0" SmallChange="{Binding SmallChange}" Width="57"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Center">
                                    <StackPanel>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Bottom"/>
                                        <telerik:RadNumericUpDown Value="{Binding Path=Bottom, Mode=TwoWay}" Minimum="0" SmallChange="{Binding SmallChange}" Width="57"/>
                                    </StackPanel>
                                    <StackPanel Margin="5 0 0 0">
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Footer"/>
                                        <telerik:RadNumericUpDown Value="{Binding Path=Footer, Mode=TwoWay}" Minimum="0" SmallChange="{Binding SmallChange}" Width="57"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                            <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_CenterOnPage" Margin="0 10 0 0"/>
                            <ContentControl IsEnabled="{Binding IsCenterOnPageEnabled}" Margin="0" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                                <StackPanel>
                                    <CheckBox Margin="0 3 0 0" telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Horizontally" IsChecked="{Binding Path=CenterHorizontally, Mode=TwoWay}"/>
                                    <CheckBox Margin="0 3 0 0" telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Vertically" IsChecked="{Binding Path=CenterVertically, Mode=TwoWay}"/>
                                </StackPanel>
                            </ContentControl>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HeaderFooterTabContentStyle" TargetType="dialogs:HeaderFooterTabContent">
        <Setter Property="Height" Value="400"/>
        <Setter Property="Width" Value="400"/>
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:HeaderFooterTabContent">
                    <Grid Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Header" Margin="0 10 0 0"/>
                                <Border Grid.Column="1" Margin="2 14 0 0" Height="1" Background="{StaticResource LineToTextSeparatorBrush}"/>
                            </Grid>
                            <telerik:RadComboBox
                                    IsEnabled="{Binding AreHeadersAndFootersSameForAllPages}"
                                    ItemsSource="{Binding HeaderTemplates}"
                                    SelectedItem="{Binding SelectedHeaderTemplate, Mode=TwoWay}"
                                    DisplayMemberPath="TextPreview"
                                    Margin="0 5"/>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_CustomHeader" Command="{Binding CreateCustomHeaderCommand}" Padding="10 5"/>
                                <telerik:RadButton telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_CustomFooter" Command="{Binding CreateCustomFooterCommand}" Margin="5 0" Padding="10 5"/>
                            </StackPanel>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Footer" Margin="0 5 0 0"/>
                                <Border Grid.Column="1" Margin="2 10 0 0" Height="1" Background="{StaticResource LineToTextSeparatorBrush}"/>
                            </Grid>
                            <telerik:RadComboBox
                                    IsEnabled="{Binding AreHeadersAndFootersSameForAllPages}"
                                    ItemsSource="{Binding FooterTemplates}"
                                    SelectedItem="{Binding SelectedFooterTemplate, Mode=TwoWay}"
                                    DisplayMemberPath="TextPreview"
                                    Margin="0 5 0 20"/>
                            <CheckBox telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_DifferentOddAndEvenPages" IsChecked="{Binding Path=DifferentOddAndEvenPages, Mode=TwoWay}"/>
                            <CheckBox Margin="0 3 0 0" telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_DifferentFirstPage" IsChecked="{Binding Path=DifferentFirstPage, Mode=TwoWay}"/>
                            <CheckBox Margin="0 3 0 0" telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_ScaleWithDocument" IsChecked="{Binding Path=ScaleWithDocument, Mode=TwoWay}"/>
                            <CheckBox Margin="0 3 0 0" telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_AlignWithPageMargins" IsChecked="{Binding Path=AlignWithPageMargins, Mode=TwoWay}"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SheetTabContentStyle" TargetType="dialogs:SheetTabContent">
        <Setter Property="Height" Value="400"/>
        <Setter Property="Width" Value="400"/>
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:SheetTabContent">
                    <Grid Margin="{TemplateBinding Padding}">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_Printing_Print" Margin="0 10 0 0" HorizontalAlignment="Left"/>
                                <Border Grid.Column="1" Margin="2 12 0 0" Height="1" Background="{StaticResource LineToTextSeparatorBrush}"/>
                            </Grid>
                            <CheckBox
                                    Margin="0 5 0 0"
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_Gridlines"
                                    IsChecked="{Binding Path=PrintGridlines, Mode=TwoWay}"
                                    Visibility="{Binding IsWorksheetActive, Converter={StaticResource BoolToVisibilityValueConverter}}"/>
                            <CheckBox
                                    Margin="0 5 0 0"
                                    telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_RowAndColumnHeadings"
                                    IsChecked="{Binding Path=PrintRowColumnHeadings, Mode=TwoWay}"
                                    Visibility="{Binding IsWorksheetActive, Converter={StaticResource BoolToVisibilityValueConverter}}"/>
                            <StackPanel Margin="0 10 0 0" Visibility="{Binding IsWorksheetActive, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_PageOrder" Margin="0 10 0 0" HorizontalAlignment="Left"/>
                                    <Border HorizontalAlignment="Stretch" Height="1" Grid.Column="1" Margin="5 12 0 0" Background="{StaticResource LineToTextSeparatorBrush}"/>
                                </Grid>
                                <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                                    <StackPanel>
                                        <RadioButton x:Name="DownThenOverButton"
                                                telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_DownThenOver"
                                                GroupName="DownThenOverOption"
                                                IsChecked="{Binding Path=PageOrder, Converter={StaticResource PageOrderToBooleanConverter}, ConverterParameter=DownThenOver, Mode=TwoWay}"
                                                Margin="0 5 0 0"/>
                                        <RadioButton x:Name="OverThenDownButton"
                                                telerik:LocalizationManager.ResourceKey="Spreadsheet_PageSetupDialog_OverThenDown"
                                                GroupName="OverThenDownOption"
                                                IsChecked="{Binding Path=PageOrder, Converter={StaticResource PageOrderToBooleanConverter}, ConverterParameter=OverThenDown, Mode=TwoWay}"
                                                Margin="0 5 0 0"/>
                                    </StackPanel>
                                    <Image
                                            Source="{telerik:IconResource IconRelativePath=Printing/downThenOver.png, IconSources={StaticResource IconPaths}}"
                                            Stretch="None"
                                            Margin="10 0 0 0"
                                            Visibility="{Binding ElementName=DownThenOverButton,Path=IsChecked, Converter={StaticResource SpreadsheetBooleanToVisibilityConverter}}"/>
                                    <Image
                                            Source="{telerik:IconResource IconRelativePath=Printing/overThenDown.png, IconSources={StaticResource IconPaths}}"
                                            Stretch="None"
                                            Margin="10 0 0 0"
                                            Visibility="{Binding ElementName=OverThenDownButton,Path=IsChecked, Converter={StaticResource SpreadsheetBooleanToVisibilityConverter}}"/>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="PageSetupDialogContentStyle" TargetType="dialogs:PageSetupDialogContent">
        <Setter Property="Header" Value="{Binding DialogHeader}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:PageSetupDialogContent">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="205*"/>
                            <RowDefinition Height="40"/>
                        </Grid.RowDefinitions>
                        <telerik:RadTabControl x:Name="TabControl" Margin="-1 0">
                            <telerik:RadTabItem Header="{Binding TabHeader}" IsSelected="{Binding IsSelected, Mode=TwoWay}" DataContext="{Binding PageTab}" MinWidth="55">
                                <dialogs:PageTabContent/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem Header="{Binding TabHeader}" IsSelected="{Binding IsSelected, Mode=TwoWay}" DataContext="{Binding MarginsTab}" MinWidth="55">
                                <dialogs:MarginsTabContent/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem Header="{Binding TabHeader}" IsSelected="{Binding IsSelected, Mode=TwoWay}" DataContext="{Binding HeaderFooterTab}" MinWidth="55">
                                <dialogs:HeaderFooterTabContent/>
                            </telerik:RadTabItem>
                            <telerik:RadTabItem Header="{Binding TabHeader}" IsSelected="{Binding IsSelected, Mode=TwoWay}" DataContext="{Binding SheetTab}" MinWidth="55">
                                <dialogs:SheetTabContent/>
                            </telerik:RadTabItem>
                        </telerik:RadTabControl>
                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Spreadsheet_Printing_Print" Height="23" MinWidth="75" Margin="10 5 0 5" Command="{Binding PrintCommand}"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Height="23" MinWidth="75" Margin="10 5 0 5" Command="{Binding OKCommand}" Grid.Column="2"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Height="23" MinWidth="75" Margin="10 5" Command="{Binding CloseCommand}" Grid.Column="3"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SortingDialogContentStyle" TargetType="dialogs:SortingDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_SortingDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder}"/>
        <Setter Property="Width" Value="600"/>
        <Setter Property="Height" Value="280"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:SortingDialogContent">
                    <Grid
                            Margin="{TemplateBinding Padding}"
                            Background="{TemplateBinding Background}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel Orientation="Horizontal" Grid.Row="0" UseLayoutRounding="True">
                            <telerik:RadButton Command="{Binding Path=AddLevelCommand}" MinWidth="83" Margin="1 5 2 5" Height="23">
                                <telerik:RadButton.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Stretch="None" Source="{telerik:IconResource IconRelativePath=16/addLevel.png, IconSources={StaticResource IconPaths}}"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_SortingDialog_AddLevel" Margin="10 0 0 0"/>
                                    </StackPanel>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <telerik:RadButton Command="{Binding Path=DeleteLevelCommand}" MinWidth="83" Margin="2 5" Height="23">
                                <telerik:RadButton.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/16/cancelFormula.png" Width="16" Stretch="None"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_SortingDialog_DeleteLevel" Margin="10 0 0 0"/>
                                    </StackPanel>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <telerik:RadButton Command="{Binding Path=CopyLevelCommand}" MinWidth="83" Margin="2 5" Height="23">
                                <telerik:RadButton.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Stretch="None" Source="{telerik:IconResource IconRelativePath=16/copy.png, IconSources={StaticResource IconPaths}}"/>
                                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_SortingDialog_CopyLevel" Margin="10 0 0 0"/>
                                    </StackPanel>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" Width="1" BorderThickness="1" Margin="2 5" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
                            <telerik:RadButton Command="{Binding Path=MoveUpCommand}" MinWidth="24" Margin="2 5" Height="23" Width="23">
                                <telerik:RadButton.Content>
                                    <Path RenderTransformOrigin="0.5 0.5" Data="M0,0 L2,0 1,1 Z" Margin="0 1" Fill="{StaticResource ControlElement_Normal}" Width="6" Height="4" Stretch="Fill">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform/>
                                                <SkewTransform/>
                                                <RotateTransform Angle="180"/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                            <telerik:RadButton Command="{Binding Path=MoveDownCommand}" MinWidth="24" Margin="2 5" Height="23" Width="23">
                                <telerik:RadButton.Content>
                                    <Path Data="M0,0 L2,0 1,1 Z" Margin="0 1" Fill="{StaticResource ControlElement_Normal}" Width="6" Height="4" Stretch="Fill"/>
                                </telerik:RadButton.Content>
                            </telerik:RadButton>
                        </StackPanel>
                        <Border Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid Background="{StaticResource SortingDialogHeaderItemBackground}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Border BorderBrush="{StaticResource SortingDialogHeaderItemSeparatorBorderBrush}" BorderThickness="0 0 1 0" Grid.Column="0">
                                        <TextBlock Text="Column" Margin="5 2"/>
                                    </Border>
                                    <Border BorderBrush="{StaticResource SortingDialogHeaderItemSeparatorBorderBrush}" BorderThickness="0 0 1 0" Grid.Column="1">
                                        <TextBlock Text="Sort On" Margin="5 2"/>
                                    </Border>
                                    <Border Grid.Column="2">
                                        <TextBlock Text="Order" Margin="5 2"/>
                                    </Border>
                                </Grid>
                                <telerik:RadListBox Grid.Row="1" BorderThickness="0 1 0 0" ItemsSource="{Binding Path=SortConditions}" SelectedIndex="{Binding Path=SelectedSortConditionIndex, Mode=TwoWay}">
                                    <telerik:RadListBox.ItemTemplate>
                                        <DataTemplate>
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>
                                                <Grid Grid.Column="0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto"/>
                                                        <ColumnDefinition Width="*"/>
                                                    </Grid.ColumnDefinitions>
                                                    <TextBlock Text="{Binding Path=Header}" Grid.Column="0" VerticalAlignment="Center" Width="50"/>
                                                    <telerik:RadComboBox
                                                            ItemsSource="{Binding Path=SortByItemsSource}"
                                                            SelectedItem="{Binding Path=SelectedRelativeIndex, Mode=TwoWay}"
                                                            HorizontalAlignment="Stretch"
                                                            Grid.Column="1"
                                                            Margin="0 0 10 0">
                                                        <telerik:RadComboBox.ItemTemplate>
                                                            <DataTemplate>
                                                                <ContentPresenter Content="{Binding Path=., Converter={StaticResource IntToColumnNameConverter}}"/>
                                                            </DataTemplate>
                                                        </telerik:RadComboBox.ItemTemplate>
                                                    </telerik:RadComboBox>
                                                </Grid>
                                                <telerik:RadComboBox
                                                        Grid.Column="1"
                                                        HorizontalAlignment="Stretch"
                                                        SelectedItem="{Binding Path=SelectedSortType, Mode=TwoWay}"
                                                        ItemsSource="{Binding Path=SortTypesItemsSource}"
                                                        Margin="0 0 10 0">
                                                    <telerik:RadComboBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <ContentPresenter Content="{Binding Path=., Converter={StaticResource SortTypeToStringConverter}}"/>
                                                        </DataTemplate>
                                                    </telerik:RadComboBox.ItemTemplate>
                                                </telerik:RadComboBox>
                                                <Grid Grid.Column="2" Visibility="{Binding Path=IsColorsSortOrderVisible, Converter={StaticResource BoolToVisibilityValueConverter}}">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"/>
                                                        <ColumnDefinition Width="*"/>
                                                    </Grid.ColumnDefinitions>
                                                    <telerik:RadComboBox
                                                            HorizontalAlignment="Stretch"
                                                            x:Name="ColorSelector"
                                                            Grid.Column="0"
                                                            Width="88"
                                                            SelectedIndex="{Binding Path=SelectedFillIndex, Mode=TwoWay}"
                                                            ItemsSource="{Binding Path=FillsItemsSource}"
                                                            Margin="0 0 10 0">
                                                        <telerik:RadComboBox.ItemTemplateSelector>
                                                            <spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                                                <spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                                    <DataTemplate>
                                                                        <TextBlock Text="No Fill" Width="80" Height="18"/>
                                                                    </DataTemplate>
                                                                </spreadsheetUtilities:PatternGradientFillTemplateSelector.DefaultPatternFillTemplate>
                                                                <spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                                    <DataTemplate>
                                                                        <spreadsheetControls:PatternFillControl
                                                                                Width="80"
                                                                                Height="18"
                                                                                ColorScheme="{Binding ElementName=ColorSelector, Path=DataContext.ColorPalette.ColorScheme}"
                                                                                PatternType="{Binding Path=PatternType}"
                                                                                PatternColor="{Binding Path=., Converter={StaticResource PatternFillToPatternColorConverter}}"
                                                                                BackgroundColor="{Binding Path=., Converter={StaticResource PatternFillToBackgroundColorConverter}}"/>
                                                                    </DataTemplate>
                                                                </spreadsheetUtilities:PatternGradientFillTemplateSelector.PatternFillTemplate>
                                                                <spreadsheetUtilities:PatternGradientFillTemplateSelector.GradientFillTemplate>
                                                                    <DataTemplate>
                                                                        <spreadsheetControls:GradientFillControl
                                                                                MaxWidth="80"
                                                                                MaxHeight="18"
                                                                                ColorScheme="{Binding ElementName=ColorSelector, Path=DataContext.ColorPalette.ColorScheme}"
                                                                                GradientType="{Binding Path=GradientType}"
                                                                                Color1="{Binding Path=Color1}"
                                                                                Color2="{Binding Path=Color2}"/>
                                                                    </DataTemplate>
                                                                </spreadsheetUtilities:PatternGradientFillTemplateSelector.GradientFillTemplate>
                                                            </spreadsheetUtilities:PatternGradientFillTemplateSelector>
                                                        </telerik:RadComboBox.ItemTemplateSelector>
                                                    </telerik:RadComboBox>
                                                    <telerik:RadComboBox HorizontalAlignment="Stretch" Grid.Column="1" ItemsSource="{Binding Path=SortOrderItemsSource}" SelectedIndex="{Binding Path=SelectedSortOrderIndex, Mode=TwoWay}"/>
                                                </Grid>
                                                <telerik:RadComboBox
                                                        HorizontalAlignment="Stretch"
                                                        MaxWidth="185"
                                                        Visibility="{Binding Path=IsColorsSortOrderVisible, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"
                                                        Grid.Column="2"
                                                        ItemsSource="{Binding Path=SortOrderItemsSource}"
                                                        SelectedIndex="{Binding Path=SelectedSortOrderIndex, Mode=TwoWay}"
                                                        ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                                                    <telerik:RadComboBox.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <StackPanel MaxWidth="300"/>
                                                        </ItemsPanelTemplate>
                                                    </telerik:RadComboBox.ItemsPanel>
                                                </telerik:RadComboBox>
                                            </Grid>
                                        </DataTemplate>
                                    </telerik:RadListBox.ItemTemplate>
                                </telerik:RadListBox>
                            </Grid>
                        </Border>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Command="{Binding Path=OKCommand}" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Command="{Binding Path=CancelCommand}" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CustomSortListsDialogContentStyle" TargetType="dialogs:CustomSortListsDialogContent">
        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="Spreadsheet_CustomSortListsDialog_Header"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Width" Value="600"/>
        <Setter Property="Height" Value="360"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CustomSortListsDialogContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <telerik:RadTabControl Margin="-1 0">
                            <telerik:RadTabItem telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomSortListsDialog_CustomListsHeader">
                                <Grid Margin="10 5">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="190"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="240"/>
                                        <ColumnDefinition Width="240"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomSortListsDialog_CustomListsLabel"/>
                                    <telerik:RadListBox
                                            Grid.Row="1"
                                            Grid.Column="0"
                                            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                            SelectedIndex="{Binding Path=SelectedCustomListIndex, Mode=TwoWay}"
                                            ItemsSource="{Binding Path=CustomListsItemsSource}"
                                            ScrollViewer.VerticalScrollBarVisibility="Visible"/>
                                    <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomSortListsDialog_ListEntriesLabel" Margin="10 0 0 0" Grid.Row="0" Grid.Column="1"/>
                                    <TextBox
                                            Margin="10 0 0 0"
                                            AcceptsReturn="True"
                                            IsEnabled="{Binding Path=IsEnabled}"
                                            Grid.Row="1"
                                            Grid.Column="1"
                                            VerticalContentAlignment="Top"
                                            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                            ScrollViewer.VerticalScrollBarVisibility="Visible"
                                            Text="{Binding Path=ListItems, Mode=TwoWay}"/>
                                    <StackPanel Grid.Column="2" Grid.Row="1" HorizontalAlignment="Center">
                                        <telerik:RadButton telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomSortListsDialog_Add" Margin="10 0 0 10" Height="23" MinWidth="75" Command="{Binding Path=AddCommand}"/>
                                        <telerik:RadButton
                                                telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomSortListsDialog_Delete"
                                                Margin="10 0 0 0"
                                                Height="23"
                                                MinWidth="75"
                                                Command="{Binding Path=DeleteCommand}"/>
                                    </StackPanel>
                                </Grid>
                            </telerik:RadTabItem>
                        </telerik:RadTabControl>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Command="{Binding Path=OKCommand}" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Command="{Binding Path=CancelCommand}" Height="23" MinWidth="75" Margin="10 5 0 5"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TopFilterDialogContentStyle" TargetType="dialogs:TopFilterDialogContent">
        <Setter Property="Header" Value="{Binding DialogHeader}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Width" Value="300"/>
        <Setter Property="Height" Value="120"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:TopFilterDialogContent">
                    <Grid
                            Margin="{TemplateBinding Padding}"
                            Background="{TemplateBinding Background}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_TopFilterDialog_Show"/>
                        <telerik:RadComboBox
                                Grid.Row="1"
                                HorizontalAlignment="Stretch"
                                Margin="0 5"
                                ItemsSource="{Binding Path=TopBottomItemsSource}"
                                SelectedValue="{Binding Path=SelectedTopBottom, Mode=TwoWay}">
                            <telerik:RadComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Converter={StaticResource TopBottomFilterTypeToStringConverter}}"/>
                                </DataTemplate>
                            </telerik:RadComboBox.ItemTemplate>
                        </telerik:RadComboBox>
                        <telerik:RadNumericUpDown Grid.Row="1" Grid.Column="1" Value="{Binding Path=SelectedValue, Mode=TwoWay}" IsInteger="True" Margin="5"/>
                        <telerik:RadComboBox
                                Grid.Row="1"
                                Grid.Column="2"
                                Margin="0 5"
                                HorizontalAlignment="Stretch"
                                ItemsSource="{Binding Path=ItemsPercentItemsSource}"
                                SelectedValue="{Binding Path=SelectedItemsPercent, Mode=TwoWay}">
                            <telerik:RadComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Converter={StaticResource ItemsPercentFilterTypeToStringConverter}}"/>
                                </DataTemplate>
                            </telerik:RadComboBox.ItemTemplate>
                        </telerik:RadComboBox>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Grid.ColumnSpan="3" VerticalAlignment="Bottom">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Command="{Binding Path=OKCommand}" Margin="10 5 0 5" Height="23" MinWidth="75"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Command="{Binding Path=CancelCommand}" Margin="10 5 0 5" Height="23" MinWidth="75"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CustomFilterDialogContentStyle" TargetType="dialogs:CustomFilterDialogContent">
        <Setter Property="Header" Value="{Binding DialogHeader}"/>
        <Setter Property="Background" Value="{StaticResource DialogsBackgroundBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Width" Value="350"/>
        <Setter Property="Height" Value="200"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="dialogs:CustomFilterDialogContent">
                    <Grid
                            Margin="{TemplateBinding Padding}"
                            Background="{TemplateBinding Background}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomFilterDialog_ShowRowsWhere" Margin="0 3 0 6"/>
                        <telerik:RadComboBox
                                Grid.Row="1"
                                HorizontalAlignment="Stretch"
                                ItemsSource="{Binding Path=ComparisonOperatorItemsSource}"
                                SelectedValue="{Binding Path=SelectedComparisonOperator1, Mode=TwoWay}">
                            <telerik:RadComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Converter={StaticResource ComparisonOperatorItemToStringConverter}}"/>
                                </DataTemplate>
                            </telerik:RadComboBox.ItemTemplate>
                        </telerik:RadComboBox>
                        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=Value1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="5 0"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" Margin="5">
                            <RadioButton IsChecked="{Binding Path=SelectedLogicalOperator, Mode=TwoWay, Converter={StaticResource LogicalOperatorToBooleanConverter}, ConverterParameter=And}" Margin="5 3" telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomFilterDialog_And"/>
                            <RadioButton IsChecked="{Binding Path=SelectedLogicalOperator, Mode=TwoWay, Converter={StaticResource LogicalOperatorToBooleanConverter}, ConverterParameter=Or}" Margin="5 3" telerik:LocalizationManager.ResourceKey="Spreadsheet_CustomFilterDialog_Or"/>
                        </StackPanel>
                        <telerik:RadComboBox Grid.Row="3" ItemsSource="{Binding Path=ComparisonOperatorItemsSource}" SelectedValue="{Binding Path=SelectedComparisonOperator2, Mode=TwoWay}">
                            <telerik:RadComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Converter={StaticResource ComparisonOperatorItemToStringConverter}}"/>
                                </DataTemplate>
                            </telerik:RadComboBox.ItemTemplate>
                        </telerik:RadComboBox>
                        <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Path=Value2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="5 0"/>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="4" Grid.ColumnSpan="2" VerticalAlignment="Bottom">
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Ok" Command="{Binding Path=OKCommand}" Margin="10 5 0 5" Height="23" MinWidth="75"/>
                            <telerik:RadButton telerik:LocalizationManager.ResourceKey="Cancel" Command="{Binding Path=CancelCommand}" Margin="10 5 0 5" Height="23" MinWidth="75"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="dialogs:FillEffectsDialogContent" BasedOn="{StaticResource FillEffectsDialogContentStyle}"/>
    <Style TargetType="dialogs:GeneralCategoryContent" BasedOn="{StaticResource GeneralCategoryContentStyle}"/>
    <Style TargetType="dialogs:NumberCategoryContent" BasedOn="{StaticResource NumberCategoryContentStyle}"/>
    <Style TargetType="dialogs:CurrencyCategoryContent" BasedOn="{StaticResource CurrencyCategoryContentStyle}"/>
    <Style TargetType="dialogs:AccountingCategoryContent" BasedOn="{StaticResource AccountingCategoryContentStyle}"/>
    <Style TargetType="dialogs:DateCategoryContent" BasedOn="{StaticResource DateCategoryContentStyle}"/>
    <Style TargetType="dialogs:TimeCategoryContent" BasedOn="{StaticResource TimeCategoryContentStyle}"/>
    <Style TargetType="dialogs:PercentageCategoryContent" BasedOn="{StaticResource PercentageCategoryContentStyle}"/>
    <Style TargetType="dialogs:FractionCategoryContent" BasedOn="{StaticResource FractionCategoryContentStyle}"/>
    <Style TargetType="dialogs:ScientificCategoryContent" BasedOn="{StaticResource ScientificCategoryContentStyle}"/>
    <Style TargetType="dialogs:TextCategoryContent" BasedOn="{StaticResource TextCategoryContentStyle}"/>
    <Style TargetType="dialogs:SpecialCategoryContent" BasedOn="{StaticResource SpecialCategoryContentStyle}"/>
    <Style TargetType="dialogs:CustomCategoryContent" BasedOn="{StaticResource CustomCategoryContentStyle}"/>
    <Style TargetType="dialogs:NumberTabContent" BasedOn="{StaticResource NumberTabContentStyle}"/>
    <Style TargetType="dialogs:FillTabContent" BasedOn="{StaticResource FillTabContentStyle}"/>
    <Style TargetType="dialogs:ProtectionTabContent" BasedOn="{StaticResource ProtectionTabContentStyle}"/>
    <Style TargetType="dialogs:AlignmentTabContent" BasedOn="{StaticResource AlignmentTabContentStyle}"/>
    <Style TargetType="dialogs:FontTabContent" BasedOn="{StaticResource FontTabContentStyle}"/>
    <Style TargetType="dialogs:BorderTabContent" BasedOn="{StaticResource BorderTabContentStyle}"/>
    <Style TargetType="dialogs:BorderStyleSelector" BasedOn="{StaticResource BorderStyleSelectorStyle}"/>
    <Style TargetType="dialogs:BorderSelector" BasedOn="{StaticResource BorderSelectorStyle}"/>
    <Style TargetType="dialogs:FormatCellsDialogContent" BasedOn="{StaticResource FormatCellsDialogContentStyle}"/>
    <Style TargetType="dialogs:DecimalNumberPromptDialogContent" BasedOn="{StaticResource DecimalNumberPromptDialogStyle}"/>
    <Style TargetType="dialogs:InsertCellsDialogContent" BasedOn="{StaticResource InsertCellsDialogStyle}"/>
    <Style TargetType="dialogs:RemoveCellsDialogContent" BasedOn="{StaticResource RemoveCellsDialogStyle}"/>
    <Style TargetType="dialogs:ScaleFactorDialogContent" BasedOn="{StaticResource ScaleFactorDialogStyle}"/>
    <Style TargetType="dialogs:InsertFunctionDialogContent" BasedOn="{StaticResource InsertFunctionDialogContentStyle}"/>
    <Style TargetType="dialogs:FunctionArgumentsDialogContent" BasedOn="{StaticResource FunctionArgumentsDialogContentStyle}"/>
    <Style TargetType="dialogs:InsertFunctionArgumentControl" BasedOn="{StaticResource InsertFunctionArgumentControlStyle}"/>
    <Style TargetType="dialogs:StyleDialogContent" BasedOn="{StaticResource StyleDialogContentStyle}"/>
    <Style TargetType="dialogs:SelectColorDialogContent" BasedOn="{StaticResource SelectColorDialogStyle}"/>
    <Style TargetType="dialogs:CreateNewThemeColorSampleControl" BasedOn="{StaticResource CreateNewThemeColorSampleControlStyle}"/>
    <Style TargetType="dialogs:CreateNewThemeColorsDialogContent" BasedOn="{StaticResource CreateNewThemeColorsDialogContentStyle}"/>
    <Style TargetType="dialogs:CreateNewThemeFontsDialogContent" BasedOn="{StaticResource CreateNewThemeFontsDialogContentStyle}"/>
    <Style TargetType="dialogs:SeriesDialogContent" BasedOn="{StaticResource SeriesDialogContentStyle}"/>
    <Style TargetType="dialogs:HyperlinkEmailCategoryContent" BasedOn="{StaticResource HyperlinkEmailCategoryContentStyle}"/>
    <Style TargetType="dialogs:HyperlinkInDocumentCategoryContent" BasedOn="{StaticResource HyperlinkInDocumentCategoryContentStyle}"/>
    <Style TargetType="dialogs:HyperlinkWebPageCategoryContent" BasedOn="{StaticResource HyperlinkWebPageCategoryContentStyle}"/>
    <Style TargetType="dialogs:HyperlinkDialogContent" BasedOn="{StaticResource HyperlinkDialogContentStyle}"/>
    <Style TargetType="dialogs:FindAndReplaceDialogContent" BasedOn="{StaticResource FindAndReplaceDialogContentStyle}"/>
    <Style TargetType="dialogs:NameManagerDialogContent" BasedOn="{StaticResource NameManagerDialogContentStyle}"/>
    <Style TargetType="dialogs:DataValidationDialogContent" BasedOn="{StaticResource DataValidationDialogContentStyle}"/>
    <Style TargetType="dialogs:CreateUpdateSpreadsheetNameDialogContent" BasedOn="{StaticResource CreateUpdateSpreadsheetNameDialogContentStyle}"/>
    <Style TargetType="dialogs:ProtectDialogContent" BasedOn="{StaticResource ProtectDialogContentStyle}"/>
    <Style TargetType="dialogs:UnprotectDialogContent" BasedOn="{StaticResource UnprotectDialogContentStyle}"/>
    <Style TargetType="dialogs:FormatFontDialogContent" BasedOn="{StaticResource FormatFontDialogContentStyle}"/>
    <Style TargetType="dialogs:HeaderFooterDialogContent" BasedOn="{StaticResource HeaderFooterDialogContentStyle}"/>
    <Style TargetType="dialogs:HeaderFooterDialogTabContent" BasedOn="{StaticResource HeaderFooterDialogTabContentStyle}"/>
    <Style TargetType="dialogs:PageSetupDialogContent" BasedOn="{StaticResource PageSetupDialogContentStyle}"/>
    <Style TargetType="dialogs:PageTabContent" BasedOn="{StaticResource PageTabContentStyle}"/>
    <Style TargetType="dialogs:MarginsTabContent" BasedOn="{StaticResource MarginsTabContentStyle}"/>
    <Style TargetType="dialogs:HeaderFooterTabContent" BasedOn="{StaticResource HeaderFooterTabContentStyle}"/>
    <Style TargetType="dialogs:SheetTabContent" BasedOn="{StaticResource SheetTabContentStyle}"/>
    <Style TargetType="dialogs:FormatShapesDialogContent" BasedOn="{StaticResource FormatShapesDialogContentStyle}"/>
    <Style TargetType="dialogs:SortingDialogContent" BasedOn="{StaticResource SortingDialogContentStyle}"/>
    <Style TargetType="dialogs:TopFilterDialogContent" BasedOn="{StaticResource TopFilterDialogContentStyle}"/>
    <Style TargetType="dialogs:CustomFilterDialogContent" BasedOn="{StaticResource CustomFilterDialogContentStyle}"/>
    <Style TargetType="dialogs:CustomSortListsDialogContent" BasedOn="{StaticResource CustomSortListsDialogContentStyle}"/>
    <Style TargetType="dialogs:AlertDialogContent" BasedOn="{StaticResource AlertDialogContentStyle}"/>
    <Style TargetType="dialogs:ConfirmDialogContent" BasedOn="{StaticResource ConfirmDialogContentStyle}"/>
    <Style TargetType="dialogs:StopDialogContent" BasedOn="{StaticResource StopDialogContentStyle}"/>
    <Style TargetType="dialogs:WarningDialogContent" BasedOn="{StaticResource WarningDialogContentStyle}"/>
    <Style TargetType="dialogs:InformationDialogContent" BasedOn="{StaticResource InformationDialogContentStyle}"/>
</ResourceDictionary>
