<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c="http://schemas.telerik.com/2008/xaml/compile"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="c"
        xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
        xmlns:localization="clr-namespace:Telerik.Windows.Controls.Localization;assembly=Telerik.Windows.Controls"
        xmlns:colorPaletteConverters="clr-namespace:Telerik.Windows.Controls.ColorPicker.Converters;assembly=Telerik.Windows.Controls.Input"
        xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
        xmlns:colorPickerConverters="clr-namespace:Telerik.Windows.Controls.ColorEditor.Converters;assembly=Telerik.Windows.Controls.Input"
        xmlns:colorMode="clr-namespace:Telerik.Windows.Controls.ColorEditor.Mode;assembly=Telerik.Windows.Controls.Input"
        xmlns:pad="clr-namespace:Telerik.Windows.Controls.ColorEditor.Pad;assembly=Telerik.Windows.Controls.Input"
        xmlns:effects="clr-namespace:Telerik.Windows.Controls.ColorEditor.Effects;assembly=Telerik.Windows.Controls.Input"
        xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
        xmlns:colorEditorHelpers="clr-namespace:Telerik.Windows.Controls.ColorEditor.Helpers;assembly=Telerik.Windows.Controls.Input"
        xmlns:calendar="clr-namespace:Telerik.Windows.Controls.Calendar;assembly=Telerik.Windows.Controls.Input"
        xmlns:telerikRating="clr-namespace:Telerik.Windows.Controls.Rating;assembly=Telerik.Windows.Controls.Input">
    <ResourceDictionary.MergedDictionaries>
        <telerik:Windows8TouchResourceDictionary/>
    </ResourceDictionary.MergedDictionaries>
    <telerik:Windows8TouchColors x:Key="Windows8TouchColors"/>
    <telerik1:ColorToBrushConverter x:Key="converter"/>
    <telerik1:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <telerik1:InvertedBooleanConverter x:Key="InvertedBooleanConverter"/>
    <telerik1:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
    <SolidColorBrush x:Key="TransparentBrush" Color="#01FFFFFF"/>
    <Thickness x:Key="CalendarTransitionPanelMargin">0 1 0 0</Thickness>
    <Thickness x:Key="CalendarViewMargin">-1 -1 0 0</Thickness>
    <Thickness x:Key="CalendarViewHeaderPadding">3</Thickness>
    <Thickness x:Key="CalendarViewHeaderMargin">0</Thickness>
    <Thickness x:Key="CalendarViewBorderThickness">1 0 1 1</Thickness>
    <Thickness x:Key="CalendarItemsMargin">2 1 1 1</Thickness>
    <Thickness x:Key="CalendarButtonMargin">1</Thickness>
    <sys:Int32 x:Key="CalendarWeekHeaderVerticalOuterBorderZIndex">0</sys:Int32>
    <sys:Int32 x:Key="CalendarWeekHeaderVerticalBackgroundZIndex">2</sys:Int32>
    <sys:Int32 x:Key="CalendarWeekHeaderHorizontalBackgroundZIndex">1</sys:Int32>
    <Thickness x:Key="CalendarWeekHeaderVerticalOuterBorderThickness">0 0 1 0</Thickness>
    <Thickness x:Key="CalendarWeekHeaderVerticalOuterBorderMargin">0 1 -2 0</Thickness>
    <Thickness x:Key="CalendarWeekHeaderVerticalBackgroundMargin">1 1 -1 1</Thickness>
    <Thickness x:Key="CalendarWeekHeaderHorizontalBackgroundMargin">1 1 1 1</Thickness>
    <Thickness x:Key="CalendarHeaderPadding">0</Thickness>
    <Thickness x:Key="ClockItemPadding">5 2 5 3</Thickness>
    <Thickness x:Key="ClockItemsMargin">2 1 1 1</Thickness>
    <TextDecorationCollection x:Key="HeaderButtonTextDecoration">Underline</TextDecorationCollection>
    <ControlTemplate x:Key="ValidationTooltipTemplate">
        <StackPanel Orientation="Horizontal">
            <Grid SnapsToDevicePixels="True">
                <AdornedElementPlaceholder x:Name="Holder"/>
                <Border BorderBrush="{telerik1:Windows8TouchResource ResourceKey=ValidationBrush}" BorderThickness="1"/>
            </Grid>
            <Grid MinHeight="36" Margin="2 0" SnapsToDevicePixels="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Path
                            Width="5"
                            Height="8"
                            Margin="0 0 -1 0"
                            Data="M4,0 L0,4 4,8Z"
                            Stretch="None"
                            StrokeThickness="0"
                            Fill="{telerik1:Windows8TouchResource ResourceKey=ValidationBrush}"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"/>
                    <Border
                            Background="{telerik1:Windows8TouchResource ResourceKey=ValidationBrush}"
                            BorderBrush="{telerik1:Windows8TouchResource ResourceKey=ValidationBrush}"
                            BorderThickness="1"
                            Grid.Column="1"
                            Padding="1">
                        <Label
                                Foreground="{telerik1:Windows8TouchResource ResourceKey=InvertedForegroundBrush}"
                                FontSize="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"
                                FontFamily="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"
                                Content="{Binding ElementName=Holder, Path=AdornedElement.(Validation.Errors).CurrentItem.ErrorContent}"/>
                    </Border>
                </Grid>
            </Grid>
        </StackPanel>
    </ControlTemplate>
    <Style x:Key="RadWatermarkTextBoxStyle" TargetType="telerik1:RadWatermarkTextBox">
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="10 7"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="AllowDrop" Value="True"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadWatermarkTextBox">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Border"/>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="PART_ContentHost" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Border"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="WatermarkStates">
                                <VisualState x:Name="WatermarkHidden">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="WatermarkVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="WatermarkVisible"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                Opacity="1"/>
                        <Border x:Name="MouseOverBorder" BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="DisabledVisualElement"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                IsHitTestVisible="False"
                                Opacity="0"/>
                        <ScrollViewer x:Name="PART_ContentHost"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                BorderThickness="0"
                                IsTabStop="False"
                                Padding="{TemplateBinding Padding}"
                                Background="Transparent"
                                Margin="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="FocusVisualElement"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="False"
                                Visibility="Collapsed"/>
                        <ContentControl x:Name="WatermarkVisualElement"
                                IsTabStop="False"
                                Opacity="0.5"
                                FontStyle="Italic"
                                Content="{TemplateBinding WatermarkContent}"
                                ContentTemplate="{TemplateBinding WatermarkTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                IsHitTestVisible="False"
                                Padding="{TemplateBinding Padding}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Foreground="{TemplateBinding Foreground}"
                                Margin="2 0 0 0">
                            <ContentControl.Template>
                                <ControlTemplate TargetType="ContentControl">
                                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{x:Null}">
                                        <ContentPresenter Margin="{TemplateBinding Padding}"/>
                                    </Border>
                                </ControlTemplate>
                            </ContentControl.Template>
                        </ContentControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerik1:RadWatermarkTextBox" BasedOn="{StaticResource RadWatermarkTextBoxStyle}"/>
    <telerik:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverterInstance"/>
    <maskedInput:HorizontalContentAlignmentToTextAlignmentConverter x:Key="HorizontalContentAlignmentToTextAlignmentConverter"/>
    <telerik:NullToVisibilityConverter x:Key="NullToVisibilityConverterInstance"/>
    <Style x:Key="RadButtonStyle" TargetType="telerik1:RadButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Padding" Value="5 8"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="Transparent"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                        <ContentPresenter x:Name="Content"
                                TextBlock.Foreground="{TemplateBinding Foreground}"
                                Margin="{TemplateBinding Padding}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                RecognizesAccessKey="True"/>
                        <Border x:Name="FocusVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                Background="{x:Null}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadPathButtonPathStyle" TargetType="Path">
        <Setter Property="Fill" Value="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
        <Setter Property="Stretch" Value="Fill"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style x:Key="RadPathButtonStyle" TargetType="telerik1:RadPathButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="PathStyle" Value="{StaticResource RadPathButtonPathStyle}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadPathButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Path" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ContentPlacement">
                                <VisualState x:Name="ContentPlacementAtLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 3 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ContentPlacementAtTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 3</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ContentPlacementAtRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>3 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ContentPlacementAtBottom">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 3 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ContentVisibilityStates">
                                <VisualState x:Name="Visible"/>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="Transparent"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Path x:Name="Path" Grid.Column="1" Grid.Row="1" Style="{TemplateBinding PathStyle}" Data="{TemplateBinding PathGeometry}"/>
                            <Grid x:Name="ContentHost" Grid.Column="1" Grid.Row="2">
                                <ContentPresenter x:Name="Content"
                                        TextBlock.Foreground="{TemplateBinding Foreground}"
                                        Margin="{TemplateBinding ContentMargin}"
                                        Content="{TemplateBinding Content}"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                        ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                        RecognizesAccessKey="True"/>
                            </Grid>
                        </Grid>
                        <Border x:Name="FocusVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                Background="{x:Null}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadToggleButtonStyle" TargetType="telerik1:RadToggleButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Padding" Value="5 8"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadToggleButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOverChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverCheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                        <Grid x:Name="CommonStatesWrapper">
                            <Border x:Name="CheckedVisual"
                                    Opacity="0"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"/>
                            <Border x:Name="MouseOverCheckedVisual"
                                    Opacity="0"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                            <Border x:Name="FocusVisual"
                                    Visibility="Collapsed"
                                    Background="{x:Null}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                        </Grid>
                        <ContentPresenter x:Name="Content"
                                Margin="{TemplateBinding Padding}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                RecognizesAccessKey="True"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadRadioButtonStyle" TargetType="telerik1:RadRadioButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Padding" Value="5 8"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadRadioButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOverChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverCheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                        <Border x:Name="FocusVisual"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{x:Null}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                        <Border x:Name="CheckedVisual"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"
                                BorderBrush="{TemplateBinding BorderBrush}"/>
                        <Border x:Name="MouseOverCheckedVisual"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <ContentPresenter x:Name="Content"
                                Margin="{TemplateBinding Padding}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                RecognizesAccessKey="True"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadDropDownButtonStyle" TargetType="telerik1:RadDropDownButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Padding" Value="5 8"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadDropDownButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsOpenState">
                                <VisualState x:Name="Closed"/>
                                <VisualState x:Name="Opened">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DropDownButtonPosition">
                                <VisualState x:Name="DropDownButtonAtLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtBottom">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="PopupPlacementState">
                                <VisualState x:Name="PlacementBottom"/>
                                <VisualState x:Name="PlacementTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="RenderTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="180"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PlacementLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="RenderTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="90"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PlacementRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DropDownIndicator" Storyboard.TargetProperty="RenderTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <TransformGroup>
                                                        <RotateTransform Angle="-90"/>
                                                    </TransformGroup>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=InvertedGradientBrush}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
                        <Border x:Name="CheckedVisual"
                                Opacity="0"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"
                                BorderBrush="Transparent"/>
                        <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>
                            <ContentControl x:Name="Content"
                                    Grid.Column="1"
                                    Grid.Row="1"
                                    IsTabStop="False"
                                    Foreground="{TemplateBinding Foreground}"
                                    Margin="{TemplateBinding Padding}"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                            <Grid x:Name="DropDownIndicator"
                                    IsHitTestVisible="False"
                                    Grid.Column="1"
                                    Grid.Row="2"
                                    HorizontalAlignment="Center"
                                    Canvas.ZIndex="2"
                                    VerticalAlignment="Center"
                                    RenderTransformOrigin="0.5,0.5"
                                    Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                                    Margin="13 3">
                                <Path x:Name="Path" Data="M 0 0 L 5 8 L 10 0 Z" Fill="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                            </Grid>
                        </Grid>
                        <Popup x:Name="DropDownPopup" AllowsTransparency="True" StaysOpen="False" Focusable="False" Placement="Bottom">
                            <Grid>
                                <Border x:Name="DropDownPopupBorder"
                                        BorderThickness="1"
                                        MinWidth="3"
                                        MinHeight="3"
                                        Width="{TemplateBinding DropDownWidth}"
                                        Height="{TemplateBinding DropDownHeight}"
                                        MaxWidth="{TemplateBinding DropDownMaxWidth}"
                                        MaxHeight="{TemplateBinding DropDownMaxHeight}"
                                        Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"
                                        BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}">
                                    <ContentControl x:Name="DropDownPopupContent"
                                            Foreground="{TemplateBinding Foreground}"
                                            Content="{TemplateBinding DropDownContent}"
                                            HorizontalContentAlignment="Stretch"
                                            VerticalContentAlignment="Stretch"
                                            ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Stretch"
                                            DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"
                                            ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                            ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                </Border>
                            </Grid>
                        </Popup>
                        <Border x:Name="FocusVisual"
                                Visibility="Collapsed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Background="{x:Null}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadSplitButtonToggleButtonStyle" BasedOn="{StaticResource RadToggleButtonStyle}" TargetType="telerik1:RadToggleButton">
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadToggleButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterMouseOverBorder"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterPressedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOverChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverCheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CheckedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="OuterBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="OuterMouseOverBorder"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <Border x:Name="OuterPressedBorder"
                                Visibility="Collapsed"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                        <Grid x:Name="CommonStatesWrapper">
                            <Border x:Name="CheckedVisual"
                                    Opacity="0"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"/>
                            <Border x:Name="MouseOverCheckedVisual"
                                    Opacity="0"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                            <Border x:Name="FocusVisual"
                                    Visibility="Collapsed"
                                    Background="{x:Null}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                        </Grid>
                        <ContentPresenter x:Name="Content"
                                Content="{TemplateBinding Content}"
                                Margin="{TemplateBinding Padding}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                RecognizesAccessKey="True"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadSplitButtonStyle" TargetType="telerik1:RadSplitButton">
        <Setter Property="IsTabStop" Value="true"/>
        <Setter Property="IsOpen" Value="false"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="ButtonPartStyle" Value="{StaticResource RadButtonStyle}"/>
        <Setter Property="TogglePartStyle" Value="{StaticResource RadSplitButtonToggleButtonStyle}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Padding" Value="5 8"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadSplitButton">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsCheckedState">
                                <VisualState x:Name="UnChecked"/>
                                <VisualState x:Name="Checked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsOpenState">
                                <VisualState x:Name="Closed"/>
                                <VisualState x:Name="Opened">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Canvas.ZIndex)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsOpenOrChecked">
                                <VisualState x:Name="OpenOrChecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="IsBackgroundVisible">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="CommonStatesWrapper" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NotOpenNotChecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DropDownButtonPosition">
                                <VisualState x:Name="DropDownButtonAtLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 -1 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtTop">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 -1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>-1 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropDownButtonAtBottom">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>2</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 -1 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ButtonPartVisibility">
                                <VisualState x:Name="ButtonInvisible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.RowSpan)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>3</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>0</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownPart" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>3</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPart" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ButtonVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundIsHidden"/>
                                <VisualState x:Name="BackgroundIsVisible"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.150">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Double>0</sys:Double>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.115">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Double>1</sys:Double>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <telerik1:RadButton x:Name="ButtonPart"
                                    IsTabStop="False"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=IsButtonPartVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
                                    Background="{TemplateBinding Background}"
                                    Style="{TemplateBinding ButtonPartStyle}"
                                    Padding="{TemplateBinding Padding}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    IsBackgroundVisible="{TemplateBinding IsBackgroundVisible}"
                                    Foreground="{TemplateBinding Foreground}"
                                    FontSize="{TemplateBinding FontSize}"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    MinHeight="{TemplateBinding MinHeight}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                    ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                    Focusable="False"/>
                            <telerik1:RadToggleButton x:Name="DropDownPart"
                                    Margin="-1 0 0 0"
                                    Grid.Row="1"
                                    Grid.Column="2"
                                    IsTabStop="False"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Background="{TemplateBinding Background}"
                                    Style="{TemplateBinding TogglePartStyle}"
                                    FontSize="{TemplateBinding FontSize}"
                                    IsBackgroundVisible="{TemplateBinding IsBackgroundVisible}"
                                    Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                                    IsChecked="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                    MinWidth="36"
                                    Focusable="False">
                                <Grid x:Name="PART_DropDownIndicatorInner"
                                        IsHitTestVisible="False"
                                        HorizontalAlignment="Center"
                                        Canvas.ZIndex="2"
                                        VerticalAlignment="Center"
                                        RenderTransformOrigin="0.5,0.5"
                                        Margin="0 0 0 0">
                                    <Path x:Name="Path"
                                            Fill="{Binding (TextElement.Foreground), RelativeSource={RelativeSource AncestorType=ContentPresenter}}"
                                            Width="10"
                                            Height="8"
                                            Data="M 0 0 L 5 8 L 10 0 Z"
                                            Margin="6 3"/>
                                </Grid>
                            </telerik1:RadToggleButton>
                        </Grid>
                        <Border x:Name="MouseOverVisual"
                                Visibility="Collapsed"
                                Background="{x:Null}"
                                BorderThickness="1"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                IsHitTestVisible="False"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=HighBrush}"/>
                        <Border x:Name="CommonStatesWrapper" Visibility="{Binding Path=IsPressed, ElementName = DropDownPart, Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
                            <Border x:Name="FocusVisual"
                                    Visibility="{Binding Path=IsPressed, ElementName = ButtonPart, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"
                                    Background="{x:Null}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"
                                    Opacity="0"
                                    BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                    IsHitTestVisible="False"/>
                        </Border>
                        <Popup x:Name="DropDownPopup" AllowsTransparency="True" StaysOpen="False" Focusable="False" Placement="Bottom">
                            <Grid>
                                <Border x:Name="DropDownPopupBorder"
                                        BorderThickness="1"
                                        MinWidth="3"
                                        MinHeight="3"
                                        Width="{TemplateBinding DropDownWidth}"
                                        Height="{TemplateBinding DropDownHeight}"
                                        MaxWidth="{TemplateBinding DropDownMaxWidth}"
                                        MaxHeight="{TemplateBinding DropDownMaxHeight}"
                                        Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"
                                        BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}">
                                    <ContentControl x:Name="DropDownPopupContent"
                                            Foreground="{TemplateBinding Foreground}"
                                            Content="{TemplateBinding DropDownContent}"
                                            ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                            HorizontalContentAlignment="Stretch"
                                            VerticalContentAlignment="Stretch"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Stretch"
                                            DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                                </Border>
                            </Grid>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerik1:RadButton" BasedOn="{StaticResource RadButtonStyle}"/>
    <Style TargetType="telerik1:RadPathButton" BasedOn="{StaticResource RadPathButtonStyle}"/>
    <Style TargetType="telerik1:RadToggleButton" BasedOn="{StaticResource RadToggleButtonStyle}"/>
    <Style TargetType="telerik1:RadRadioButton" BasedOn="{StaticResource RadRadioButtonStyle}"/>
    <Style TargetType="telerik1:RadDropDownButton" BasedOn="{StaticResource RadDropDownButtonStyle}"/>
    <Style TargetType="telerik1:RadSplitButton" BasedOn="{StaticResource RadSplitButtonStyle}"/>
    <ControlTemplate x:Key="NonEditableComboToggleButtonControlTemplate" TargetType="telerik:RadToggleButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ToggleButtonBackgroundChecked"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ToggleButtonBackgroundChecked"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="BorderBrush">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Opacity" To="0.5"/>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FocusVisual">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckedStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ToggleButtonBackgroundChecked"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Indeterminate"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="ToggleButtonBackground"
                    Grid.ColumnSpan="2"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"/>
            <Border x:Name="ToggleButtonBackgroundChecked"
                    Grid.ColumnSpan="2"
                    Background="{telerik:Windows8TouchResource ResourceKey=InvertedGradientBrush}"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"/>
            <Border x:Name="FocusVisual" Grid.ColumnSpan="2" BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}" BorderThickness="1" Visibility="Collapsed"/>
            <Border MinWidth="{TemplateBinding MinWidth}" HorizontalAlignment="Right" Grid.Column="1">
                <Path x:Name="DropDownIcon"
                        Data="M0,0 L2,0 1,1 Z"
                        Stretch="Fill"
                        Width="10"
                        Height="8"
                        Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center"/>
            </Border>
            <ContentPresenter x:Name="Content"
                    TextBlock.Foreground="{TemplateBinding Foreground}"
                    Margin="{TemplateBinding Padding}"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                <ContentPresenter.Resources>
                    <Style TargetType="TextBlock">
                        <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
                    </Style>
                </ContentPresenter.Resources>
            </ContentPresenter>
        </Grid>
    </ControlTemplate>
    <Style x:Key="NonEditableComboToggleButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Template" Value="{StaticResource NonEditableComboToggleButtonControlTemplate}"/>
        <Setter Property="MinWidth" Value="36"/>
    </Style>
    <Style x:Key="ComboBoxTextBoxStyle" TargetType="TextBox">
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
    </Style>
    <ControlTemplate x:Key="EditableComboToggleButtonControlTemplate" TargetType="telerik:RadToggleButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Pressed"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Opacity" To="0.5"/>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="ToggleButtonBackground" Storyboard.TargetProperty="Opacity" To="0.5"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckedStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked"/>
                    <VisualState x:Name="Indeterminate"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="ToggleButtonBackground"
                    Grid.ColumnSpan="2"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"/>
            <Path x:Name="DropDownIcon" Data="M0,0 L2,0 1,1 Z" Stretch="Fill" Width="10" Height="8" Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="EditableComboToggleButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="Template" Value="{StaticResource EditableComboToggleButtonControlTemplate}"/>
        <Setter Property="MinWidth" Value="36"/>
    </Style>
    <ControlTemplate x:Key="EditableComboBox" TargetType="telerikInput:RadComboBox">
        <Grid x:Name="VisualRoot">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PART_EditableTextBox" Storyboard.TargetProperty="Opacity" To="0.5"/>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To="0"/>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="0.5"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Watermark" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DropDownOpenBorder">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_DropDownButton" Storyboard.TargetProperty="BorderBrush">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=HighBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownOpenBorder" Storyboard.TargetProperty="BorderBrush">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=HighBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="DropDownOpen">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="FocusBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DropDownOpenBorder">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_DropDownButton" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="DropDownButtonOpenBorder" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FocusBorder">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="FocusDropDownButton" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="WatermarkStates">
                    <VisualState x:Name="WatermarkVisible">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Watermark" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="WatermarkInvisible"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="Background" Grid.ColumnSpan="2" IsHitTestVisible="False" Background="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
            <Border x:Name="Border" Grid.ColumnSpan="2" IsHitTestVisible="False" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
            <TextBox x:Name="PART_EditableTextBox"
                    Grid.Column="0"
                    Margin="1 1 0 1"
                    Padding="{TemplateBinding Padding}"
                    VerticalAlignment="Stretch"
                    VerticalContentAlignment="Center"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    IsReadOnly="{TemplateBinding IsReadOnly}"
                    Style="{StaticResource ComboBoxTextBoxStyle}"
                    FocusVisualStyle="{x:Null}">
                <TextBox.Template>
                    <ControlTemplate TargetType="TextBox">
                        <Grid>
                            <ScrollViewer
                                    Padding="{TemplateBinding Padding}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Background="{TemplateBinding Background}"
                                    IsTabStop="False"
                                    VerticalScrollBarVisibility="Auto"
                                    x:Name="PART_ContentHost"
                                    VerticalContentAlignment="Stretch"/>
                        </Grid>
                    </ControlTemplate>
                </TextBox.Template>
            </TextBox>
            <telerik:RadToggleButton x:Name="PART_DropDownButton"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Grid.Column="1"
                    IsTabStop="False"
                    ClickMode="Press"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    Style="{StaticResource EditableComboToggleButtonStyle}"/>
            <Border x:Name="DropDownOpenBorder"
                    Visibility="Collapsed"
                    IsHitTestVisible="False"
                    Grid.ColumnSpan="2"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <Border x:Name="DropDownButtonOpenBorder"
                    Opacity="0"
                    IsHitTestVisible="False"
                    Grid.ColumnSpan="2"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <Border x:Name="FocusDropDownButton"
                    Opacity="0"
                    Grid.Column="1"
                    IsHitTestVisible="False"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <Border x:Name="FocusBorder"
                    Visibility="Collapsed"
                    IsHitTestVisible="False"
                    Grid.ColumnSpan="2"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <TextBlock x:Name="Watermark"
                    Text="{TemplateBinding EmptyText}"
                    Opacity=".5"
                    IsHitTestVisible="False"
                    Padding="{TemplateBinding Padding}"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Left"
                    Margin="5 0 0 0"
                    Visibility="Collapsed"/>
            <Popup x:Name="PART_Popup" Margin="0 1" VerticalOffset="1">
                <Grid x:Name="PopupRoot">
                    <Border
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"
                            MinWidth="{TemplateBinding MinDropDownWidth}"
                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
                            Background="{telerik:Windows8TouchResource ResourceKey=MainBrush}"
                            x:Name="PART_ResizeBorder">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <telerik:RadButton x:Name="PART_ClearButton"
                                    Grid.Row="0"
                                    Margin="-1 -1 -1 0"
                                    Visibility="{TemplateBinding ClearSelectionButtonVisibility}"
                                    Content="{TemplateBinding ClearSelectionButtonContent}"/>
                            <ScrollViewer x:Name="PART_ScrollViewer"
                                    Grid.Row="1"
                                    BorderThickness="0"
                                    VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                                    HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                    Foreground="{TemplateBinding Foreground}"
                                    CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}">
                                <ItemsPresenter Margin="2"/>
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="NonEditableComboBox" TargetType="telerikInput:RadComboBox">
        <Grid x:Name="VisualRoot">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundBorder" Storyboard.TargetProperty="Opacity" To="0"/>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PART_DropDownButton" Storyboard.TargetProperty="Opacity" To="0.5"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="DropDownOpen"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FocusBorder">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="BackgroundBorder" IsHitTestVisible="False" Background="{TemplateBinding Background}"/>
            <telerik:RadToggleButton x:Name="PART_DropDownButton"
                    IsTabStop="False"
                    Padding="{TemplateBinding Padding}"
                    ClickMode="Press"
                    Foreground="{TemplateBinding Foreground}"
                    Content="{TemplateBinding SelectionBoxItem}"
                    ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    Style="{StaticResource NonEditableComboToggleButtonStyle}"
                    FontSize="{TemplateBinding FontSize}"
                    FontFamily="{TemplateBinding FontFamily}"/>
            <Border x:Name="FocusBorder"
                    IsHitTestVisible="False"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Visibility="Collapsed"
                    Background="Transparent"/>
            <Popup x:Name="PART_Popup" VerticalOffset="1" Margin="0 1">
                <Grid x:Name="PopupRoot">
                    <Border
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"
                            MinWidth="{TemplateBinding MinDropDownWidth}"
                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
                            Background="{telerik:Windows8TouchResource ResourceKey=MainBrush}"
                            x:Name="PART_ResizeBorder">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <telerik:RadButton x:Name="PART_ClearButton"
                                    Grid.Row="0"
                                    Margin="-1 -1 -1 0"
                                    Visibility="{TemplateBinding ClearSelectionButtonVisibility}"
                                    Content="{TemplateBinding ClearSelectionButtonContent}"/>
                            <ScrollViewer x:Name="PART_ScrollViewer"
                                    Grid.Row="1"
                                    BorderThickness="0"
                                    VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                                    HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                    Foreground="{TemplateBinding Foreground}"
                                    CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}">
                                <ItemsPresenter Margin="2"/>
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadComboBoxItemStyle" TargetType="telerikInput:RadComboBoxItem">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="3 8"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadComboBoxItem">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HighlightVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border x:Name="HighlightVisual"
                                    Visibility="Collapsed"
                                    Background="{telerik:Windows8TouchResource ResourceKey=LowBrush}"
                                    AutomationProperties.AutomationId="HighlightVisual"/>
                            <Border x:Name="SelectedVisual" Background="{telerik:Windows8TouchResource ResourceKey=LowBrush}" Opacity="0"/>
                            <ContentPresenter x:Name="Content"
                                    Margin="{TemplateBinding Padding}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerikInput:RadComboBox}}, Path=AllowMultipleSelection}" Value="True"/>
                                <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Mode=Self}}" Value="True"/>
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter TargetName="HighlightVisual" Property="Opacity" Value="0"/>
                                <Setter TargetName="SelectedVisual" Property="Opacity" Value="1"/>
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadComboBoxStyle" TargetType="telerikInput:RadComboBox">
        <Setter Property="Template" Value="{StaticResource NonEditableComboBox}"/>
        <Setter Property="EditableTemplate" Value="{StaticResource EditableComboBox}"/>
        <Setter Property="NonEditableTemplate" Value="{StaticResource NonEditableComboBox}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="5 2"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Continue"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
    </Style>
    <Style TargetType="telerikInput:RadComboBoxItem" BasedOn="{StaticResource RadComboBoxItemStyle}"/>
    <Style TargetType="telerikInput:RadComboBox" BasedOn="{StaticResource RadComboBoxStyle}"/>
    <localization:CultureToLocalizationStringConverter x:Key="cultureConverter"/>
    <telerik1:LocalizationManager x:Key="localizationManager"/>
    <Style TargetType="telerik1:RadButton" x:Key="RadColorPicker_HeaderButtonStyle">
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" MinWidth="25"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="MouseOverVisual" Grid.ColumnSpan="2" Opacity="0" Background="{telerik:Windows8TouchResource ResourceKey=LowBrush}"/>

                        <!-- this x:Name is called from code -->
                        <Rectangle Fill="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Width="36" Height="36" Margin="6 6 2 6"/>
                        <ContentControl
                                Grid.Column="1"
                                x:Name="contentPresenter"
                                Margin="7 0 0 0"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Left"
                                Foreground="{TemplateBinding Foreground}"
                                FontSize="{TemplateBinding FontSize}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <colorPaletteConverters:PositionStateToBorderThicknessConverter x:Key="PositionConverter"/>
    <Style x:Key="RadColorPaletteViewItemStyle" TargetType="telerikInput:RadColorPaletteViewItem">
        <Setter Property="Margin" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadColorPaletteViewItem">
                    <Grid x:Name="RootElement" SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="Normal"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="SelectedVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="Content" ToolTipService.ToolTip="{Binding}" MinHeight="36" MinWidth="36"/>
                        <Border x:Name="MouseOverVisual" BorderThickness="1" Margin="-1" Opacity="0" BorderBrush="{telerik1:Windows8TouchResource ResourceKey=InvertedBrush}"/>
                        <Border x:Name="SelectedVisual" BorderThickness="1" Margin="-1" Opacity="0" BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadColorPaletteViewStyle" TargetType="telerikInput:RadColorPaletteView">
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadColorPaletteView">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
                        <ItemsPresenter x:Name="ItemsPresenter" Margin="4"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <primitives:RadUniformGrid x:Name="uniformGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Columns="10" ChildrenFlow="Vertical"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Margin" Value="0"/>
    </Style>
    <Style x:Key="RadColorSelectorStyle" TargetType="telerikInput:RadColorSelector">
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="MainPaletteHeaderText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorMainPaletteHeaderText}"/>
        <Setter Property="NoColorText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorAutomaticColorText}"/>
        <Setter Property="RecentColorsHeaderText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorRecentColorsHeaderText}"/>
        <Setter Property="StandardPaletteHeaderText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorStandardPaletteHeaderText}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamilyLight}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeXL}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadColorSelector">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="RootElement" Margin="0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <telerik1:RadButton
                                    Content="{TemplateBinding NoColorText}"
                                    x:Name="PaletteHeader"
                                    Grid.Row="0"
                                    Background="{TemplateBinding Background}"
                                    Tag="{Binding AutomaticColor, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource converter}}"
                                    Style="{StaticResource RadColorPicker_HeaderButtonStyle}"
                                    FontSize="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
                            <TextBlock x:Name="mainPaletteHeader"
                                    FontStyle="{TemplateBinding FontStyle}"
                                    FontWeight="{TemplateBinding FontWeight}"
                                    Foreground="{TemplateBinding Foreground}"
                                    VerticalAlignment="Center"
                                    Text="{TemplateBinding MainPaletteHeaderText}"
                                    FontSize="{TemplateBinding FontSize}"
                                    Grid.Row="1"
                                    Margin="10 2 2 2"/>
                            <telerikInput:RadColorPaletteView x:Name="HeaderPalette"
                                    Background="{TemplateBinding Background}"
                                    Grid.Row="2"
                                    ItemTemplate="{TemplateBinding PaletteItemsTemplate}"
                                    ColorPropertyPath="{TemplateBinding ColorPropertyPath}"
                                    Margin="0 0 0 -3"
                                    VerticalAlignment="Center"
                                    BorderBrush="Transparent"
                                    BorderThickness="0">
                                <telerikInput:RadColorPaletteView.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <primitives:RadUniformGrid Background="Transparent" Columns="10"/>
                                    </ItemsPanelTemplate>
                                </telerikInput:RadColorPaletteView.ItemsPanel>
                            </telerikInput:RadColorPaletteView>
                            <telerikInput:RadColorPaletteView x:Name="MainPalette"
                                    Grid.Row="3"
                                    Margin="0 5 0 2"
                                    ItemTemplate="{TemplateBinding PaletteItemsTemplate}"
                                    ColorPropertyPath="{TemplateBinding ColorPropertyPath}"
                                    ItemContainerStyle="{TemplateBinding MainPaletteItemsStyle}"
                                    PaletteColumnsCount="{TemplateBinding MainPaletteColumnsCount}"
                                    BorderBrush="Transparent"
                                    BorderThickness="0"
                                    Background="{TemplateBinding Background}"/>
                            <Border x:Name="StandardPaletteBorder" Grid.Row="4">
                                <TextBlock x:Name="standardPaletteHeader"
                                        FontWeight="{TemplateBinding FontWeight}"
                                        Foreground="{TemplateBinding Foreground}"
                                        VerticalAlignment="Center"
                                        Text="{TemplateBinding StandardPaletteHeaderText}"
                                        FontSize="{TemplateBinding FontSize}"
                                        Margin="10 2 2 2"/>
                            </Border>
                            <telerikInput:RadColorPaletteView x:Name="StandartPalette"
                                    Margin="0 0 0 1"
                                    ItemTemplate="{TemplateBinding PaletteItemsTemplate}"
                                    ColorPropertyPath="{TemplateBinding ColorPropertyPath}"
                                    VerticalAlignment="Center"
                                    Grid.Row="5"
                                    BorderBrush="Transparent"
                                    BorderThickness="0"
                                    Background="{TemplateBinding Background}">
                                <telerikInput:RadColorPaletteView.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <primitives:RadUniformGrid Background="Transparent" Columns="10"/>
                                    </ItemsPanelTemplate>
                                </telerikInput:RadColorPaletteView.ItemsPanel>
                            </telerikInput:RadColorPaletteView>
                            <Border x:Name="RecentColorsPaletteBorder" Grid.Row="6" Visibility="Collapsed" Margin="0 2 0 3">
                                <TextBlock x:Name="RecentColorsPaletteHeader"
                                        FontWeight="{TemplateBinding FontWeight}"
                                        Foreground="{TemplateBinding Foreground}"
                                        VerticalAlignment="Center"
                                        Text="{TemplateBinding RecentColorsHeaderText}"
                                        FontSize="{TemplateBinding FontSize}"
                                        Margin="10 2 2 2"/>
                            </Border>
                            <telerikInput:RadColorPaletteView
                                    Grid.Row="7"
                                    x:Name="RecentColorsPalette"
                                    Margin="0 0 0 1"
                                    ItemTemplate="{TemplateBinding PaletteItemsTemplate}"
                                    ColorPropertyPath="{TemplateBinding ColorPropertyPath}"
                                    BorderThickness="0"
                                    Background="{TemplateBinding Background}"
                                    Visibility="Collapsed"
                                    VerticalAlignment="Center"
                                    BorderBrush="Transparent"
                                    MinHeight="50">
                                <telerikInput:RadColorPaletteView.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <primitives:RadUniformGrid Background="Transparent" Columns="10" Rows="1"/>
                                    </ItemsPanelTemplate>
                                </telerikInput:RadColorPaletteView.ItemsPanel>
                            </telerikInput:RadColorPaletteView>
                            <Border Margin="0 1 0 0" Visibility="Collapsed" x:Name="AdditionalContentBorder" Grid.Row="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 1 0 0">
                                <ContentPresenter Margin="0 1 0 0" Content="{TemplateBinding AdditionalContent}" ContentTemplate="{TemplateBinding AdditionalContentTemplate}"/>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TogglePartCustomStyle" TargetType="telerik1:RadToggleButton">
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadToggleButton">
                    <Grid x:Name="Root" Background="Transparent" SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pressed"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="DisabledChecked"/>
                                <VisualState x:Name="MouseOverChecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="normal">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="checked"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundHidden">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="normal"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundVisible"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="normal"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="pressed"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=InvertedGradientBrush}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <Border x:Name="checked"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"
                                BorderBrush="#FFCCCCCC"
                                Opacity="0"
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                        <ContentControl
                                Margin="{TemplateBinding Padding}"
                                IsTabStop="False"
                                Content="{TemplateBinding Content}"
                                Foreground="{TemplateBinding Foreground}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ColorPickerSplitButtonStyle" TargetType="telerik1:RadSplitButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="IsOpen" Value="False"/>
        <Setter Property="TogglePartStyle" Value="{StaticResource TogglePartCustomStyle}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadSplitButton">
                    <Grid x:Name="Root" SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Root"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IsCheckedState">
                                <VisualState x:Name="UnChecked"/>
                                <VisualState x:Name="Checked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStatesGroup">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FocusedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BackgroundVisibility">
                                <VisualState x:Name="BackgroundHidden">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="normal"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="BackgroundVisible"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="NormalVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                BorderBrush="{TemplateBinding BorderBrush}"/>
                        <Grid>
                            <telerik1:RadButton x:Name="ButtonPart"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=IsButtonPartVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    Padding="{TemplateBinding Padding}"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsBackgroundVisible="{TemplateBinding IsBackgroundVisible}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                                <telerik1:RadButton.Template>
                                    <ControlTemplate TargetType="telerik1:RadButton">
                                        <Grid x:Name="Root"/>
                                    </ControlTemplate>
                                </telerik1:RadButton.Template>
                            </telerik1:RadButton>
                            <telerik1:RadToggleButton x:Name="DropDownPart"
                                    MinWidth="36"
                                    Visibility="{TemplateBinding DropDownIndicatorVisibility}"
                                    IsBackgroundVisible="{TemplateBinding IsBackgroundVisible}"
                                    Style="{TemplateBinding TogglePartStyle}"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    IsChecked="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                        </Grid>
                        <Border x:Name="MouseOverVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{x:Null}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=InvertedBrush}"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Opacity="0"
                                IsHitTestVisible="False"/>
                        <Border x:Name="FocusedVisual"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{x:Null}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=InvertedBrush}"
                                Opacity="0.3"
                                CornerRadius="{TemplateBinding CornerRadius}"
                                Visibility="Collapsed"
                                IsHitTestVisible="False"/>
                        <Popup x:Name="DropDownPopup" AllowsTransparency="True" StaysOpen="False" Focusable="False" Placement="Bottom">
                            <Grid>
                                <Border x:Name="DropDownPopupBorder"
                                        BorderThickness="1"
                                        BorderBrush="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                                        Background="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"
                                        CornerRadius="{TemplateBinding CornerRadius}"
                                        Margin="0"
                                        MinWidth="3"
                                        MinHeight="3"
                                        Width="{TemplateBinding DropDownWidth}"
                                        Height="{TemplateBinding DropDownHeight}"
                                        MaxWidth="{TemplateBinding DropDownMaxWidth}"
                                        MaxHeight="{TemplateBinding DropDownMaxHeight}">
                                    <ContentPresenter x:Name="DropDownPopupContent"
                                            Content="{TemplateBinding DropDownContent}"
                                            ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Stretch"
                                            DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                                </Border>
                            </Grid>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadColorPickerStyle" TargetType="telerikInput:RadColorPicker">
        <Setter Property="MainPaletteColumnsCount" Value="10"/>
        <Setter Property="MainPaletteOrientation" Value="Vertical"/>
        <Setter Property="MainPalette" Value="Office"/>
        <Setter Property="HeaderPaletteVisibility" Value="Visible"/>
        <Setter Property="MainPaletteHeaderText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorMainPaletteHeaderText}"/>
        <Setter Property="NoColorText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorAutomaticColorText}"/>
        <Setter Property="RecentColorsHeaderText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorRecentColorsHeaderText}"/>
        <Setter Property="StandardPaletteHeaderText" Value="{Binding Manager.Culture, Source={StaticResource localizationManager}, Converter={StaticResource cultureConverter}, ConverterParameter=ColorSelectorStandardPaletteHeaderText}"/>
        <Setter Property="StandardPaletteVisibility" Value="Visible"/>
        <Setter Property="NoColorVisibility" Value="Visible"/>
        <Setter Property="SelectedColor" Value="Black"/>
        <Setter Property="StandardPalette" Value="Standard"/>
        <Setter Property="HeaderPalette" Value="Office"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="SplitButtonStyle" Value="{StaticResource ColorPickerSplitButtonStyle}"/>
        <Setter Property="ColorSelectorStyle" Value="{StaticResource RadColorSelectorStyle}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="AutomaticColor" Value="Black"/>
        <Setter Property="Width" Value="36"/>
        <Setter Property="Height" Value="36"/>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid SnapsToDevicePixels="True">
                        <Rectangle Width="24" Height="24">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{Binding}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Path
                                Fill="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"
                                Data="M7.9265018,2.8563457 C7.8888092,3.324965 7.7945805,3.789866 7.643816,4.2510457 L5.8798585,9.6736393 L10.029682,9.6736393 L8.2883396,4.2956767 C8.1601868,3.8940024 8.0697289,3.4142261 8.0169601,2.8563457 z M5.9024739,0 L10.233215,0 L15.999999,16 L12.019787,16 L10.86643,12.440725 L5.0996456,12.440725 L3.9575977,16 L0,16 z"
                                HorizontalAlignment="Center"
                                Height="16"
                                Width="16"
                                Stretch="Fill"
                                VerticalAlignment="Center"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadColorPicker">
                    <Grid x:Name="Root"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}"
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <telerik1:RadSplitButton x:Name="SplitButton"
                                Style="{TemplateBinding SplitButtonStyle}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                DropDownPlacement="{Binding Path=DropDownPlacement, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                DropDownIndicatorVisibility="Visible"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                Padding="{TemplateBinding Padding}"
                                IsOpen="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                IsChecked="{Binding Path=IsOpen, RelativeSource={RelativeSource Self}}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}">
                            <telerik1:RadSplitButton.DropDownContent>
                                <telerikInput:RadColorSelector x:Name="ColorSelector"
                                        Style="{TemplateBinding ColorSelectorStyle}"
                                        Command="{TemplateBinding Command}"
                                        CommandParameter="{TemplateBinding CommandParameter}"
                                        CommandTarget="{TemplateBinding CommandTarget}"
                                        ColorPropertyPath="{TemplateBinding ColorPropertyPath}"
                                        MainPalette="{TemplateBinding MainPalette}"
                                        MainPaletteItemsStyle="{TemplateBinding MainPaletteItemsStyle}"
                                        MainPaletteColumnsCount="{TemplateBinding MainPaletteColumnsCount}"
                                        MainPaletteItemsSource="{TemplateBinding MainPaletteItemsSource}"
                                        MainPaletteOrientation="{TemplateBinding MainPaletteOrientation}"
                                        MainPaletteHeaderText="{TemplateBinding MainPaletteHeaderText}"
                                        HeaderPalette="{TemplateBinding HeaderPalette}"
                                        HeaderPaletteVisibility="{TemplateBinding HeaderPaletteVisibility}"
                                        HeaderPaletteItemsSource="{TemplateBinding HeaderPaletteItemsSource}"
                                        StandardPalette="{TemplateBinding StandardPalette}"
                                        StandardPaletteVisibility="{TemplateBinding StandardPaletteVisibility}"
                                        StandardPaletteHeaderText="{TemplateBinding StandardPaletteHeaderText}"
                                        StandardPaletteItemsSource="{TemplateBinding StandardPaletteItemsSource}"
                                        PaletteItemsTemplate="{TemplateBinding PaletteItemsTemplate}"
                                        AutomaticColor="{Binding AutomaticColor, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                        NoColorText="{TemplateBinding NoColorText}"
                                        RecentColorsHeaderText="{TemplateBinding RecentColorsHeaderText}"
                                        RecentColorsVisibility="{TemplateBinding RecentColorsVisibility}"
                                        IsRecentColorsActive="{TemplateBinding IsRecentColorsActive}"
                                        RecentColorsItemsSource="{TemplateBinding RecentColorsItemsSource}"
                                        AdditionalContent="{TemplateBinding AdditionalContent}"
                                        AdditionalContentTemplate="{TemplateBinding AdditionalContentTemplate}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="1"
                                        NoColorVisibility="{TemplateBinding NoColorVisibility}"
                                        SelectedColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedColor, Mode=TwoWay}"
                                        SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem, Mode=TwoWay}"
                                        FontWeight="{TemplateBinding FontWeight}"
                                        FontStyle="{TemplateBinding FontStyle}"
                                        Foreground="{TemplateBinding Foreground}"
                                        Margin="-1"/>
                            </telerik1:RadSplitButton.DropDownContent>
                        </telerik1:RadSplitButton>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikInput:RadColorPaletteViewItem" BasedOn="{StaticResource RadColorPaletteViewItemStyle}"/>
    <Style TargetType="telerikInput:RadColorPaletteView" BasedOn="{StaticResource RadColorPaletteViewStyle}"/>
    <Style TargetType="telerikInput:RadColorSelector" BasedOn="{StaticResource RadColorSelectorStyle}"/>
    <Style TargetType="telerikInput:RadColorPicker" BasedOn="{StaticResource RadColorPickerStyle}"/>
    <colorPickerConverters:HueConverter x:Key="HueConverter"/>
    <colorPickerConverters:EnumConverter x:Key="EnumConverter"/>
    <colorPickerConverters:ColorToHSColorBrushConverter x:Key="ColorToHSColorBrushConverter"/>
    <colorMode:ColorModeCollection x:Key="ColorModeCollection"/>
    <LinearGradientBrush x:Key="HueBrush" StartPoint="0.5,0.025" EndPoint="0.5,1">
        <GradientStop Color="#FFFF0000"/>
        <GradientStop Color="#FEFFFF00" Offset="0.167"/>
        <GradientStop Color="#FE00FF00" Offset="0.333"/>
        <GradientStop Color="#FE00FFFF" Offset="0.5"/>
        <GradientStop Color="#FE0000FF" Offset="0.667"/>
        <GradientStop Color="#FEFF00FF" Offset="0.833"/>
        <GradientStop Color="#FFFF0000" Offset="1.0"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HueBrushHorizontal" StartPoint="0, 0.5" EndPoint="1,0.5">
        <GradientStop Color="#FFFF0000"/>
        <GradientStop Color="#FEFFFF00" Offset="0.167"/>
        <GradientStop Color="#FE00FF00" Offset="0.333"/>
        <GradientStop Color="#FE00FFFF" Offset="0.5"/>
        <GradientStop Color="#FE0000FF" Offset="0.667"/>
        <GradientStop Color="#FEFF00FF" Offset="0.833"/>
        <GradientStop Color="#FFFF0000" Offset="1.0"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ZeroGrayBrush" StartPoint="0.5, 0" EndPoint="0.5, 1">
        <GradientStop Color="Transparent" Offset="0"/>
        <GradientStop Color="Gray" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ZeroToWhiteBrush" StartPoint="0.5, 1" EndPoint="0.5,0">
        <GradientStop Color="Transparent" Offset="0.1"/>
        <GradientStop Color="White" Offset="0.9"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ZeroToBlackBrush" StartPoint="0.5, 0" EndPoint="0.5,1">
        <GradientStop Color="Transparent" Offset="0.1"/>
        <GradientStop Color="Black" Offset="0.9"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="SaturationValueBrush1" EndPoint="1,0.5" StartPoint="0,0.5">
        <GradientStop Color="#FFFFFFFF"/>
        <GradientStop Color="#00FFFFFF" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="SaturationValueBrush2" EndPoint="0.5,0" StartPoint="0.5,1">
        <GradientStop Color="#FF000000" Offset="0"/>
        <GradientStop Color="#00000000" Offset="1"/>
    </LinearGradientBrush>
    <Style x:Key="PadStyle" TargetType="pad:Pad">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="pad:Pad">
                    <Grid Background="Transparent">
                        <Canvas x:Name="Canvas">
                            <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}"/>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadColorEditorStyle" TargetType="telerikInput:RadColorEditor">
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadColorEditor">
                    <Border x:Name="LayoutRoot"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ColorModeStates">
                                <VisualState x:Name="Rgb">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RgbTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HlsTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HsvTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CmykTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hls">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RgbTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HlsTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HsvTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CmykTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hsv">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RgbTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HlsTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HsvTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CmykTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Cmyk">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RgbTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HlsTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HsvTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CmykTemplate" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="SectionsGrid">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" MinHeight="220"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid x:Name="SaturationValuePadGrid" Margin="0 0 7 7">
                                <Rectangle Fill="{Binding PointerRelativePosition.Y, ElementName=HuePad, Converter={StaticResource HueConverter}}"/>
                                <Rectangle Fill="{StaticResource SaturationValueBrush1}"/>
                                <Rectangle Fill="{StaticResource SaturationValueBrush2}"/>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <pad:Pad x:Name="SaturationValuePad" MovementDirection="Both">
                                        <Grid Width="30" Height="30">
                                            <Ellipse Stroke="White" StrokeThickness="1" Margin="2"/>
                                            <Ellipse Stroke="Black" StrokeThickness="1" Margin="1"/>
                                            <Ellipse Stroke="White" StrokeThickness="1"/>
                                        </Grid>
                                    </pad:Pad>
                                </Border>
                            </Grid>
                            <Grid x:Name="HueSaturationPadGrid" Margin="0 0 7 7">
                                <Rectangle Fill="{StaticResource HueBrushHorizontal}"/>
                                <Rectangle Fill="{StaticResource ZeroGrayBrush}"/>
                                <pad:Pad x:Name="HueSaturationPad" MovementDirection="Both">
                                    <Grid Width="30" Height="30">
                                        <Ellipse Stroke="White" StrokeThickness="1" Margin="2"/>
                                        <Ellipse Stroke="Black" StrokeThickness="1" Margin="1"/>
                                        <Ellipse Stroke="White" StrokeThickness="1"/>
                                    </Grid>
                                </pad:Pad>
                            </Grid>
                            <Grid x:Name="InitAndCurrentColorGrid" Grid.Row="1" Margin="0 0 7 0" Height="36">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border x:Name="ChessBoardRect" Grid.ColumnSpan="2" Background="Black" BorderThickness="1 1 2 1">
                                    <Border.Effect>
                                        <effects:ChessboardEffect/>
                                    </Border.Effect>
                                </Border>
                                <Border x:Name="PART_InitialColor"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="1 1 0 1"
                                        Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=InitialColor, Converter={StaticResource converter}}">
                                    <ToolTipService.ToolTip>
                                        <TextBlock Text="{telerik:LocalizableResource Key=ColorEditorInitialColor}"/>
                                    </ToolTipService.ToolTip>
                                </Border>
                                <Border
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="0 1 1 1"
                                        Grid.Column="1"
                                        Margin="-1 0 0 0"
                                        Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedColor, Converter={StaticResource converter}}">
                                    <ToolTipService.ToolTip>
                                        <TextBlock Text="{telerik:LocalizableResource Key=ColorEditorSelectedColor}"/>
                                    </ToolTipService.ToolTip>
                                </Border>
                                <Border
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="1"
                                        Grid.Column="2"
                                        Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PreviousColor, Converter={StaticResource converter}}"
                                        Margin="7 0 0 0"
                                        Width="36">
                                    <ToolTipService.ToolTip>
                                        <TextBlock Text="{telerik:LocalizableResource Key=ColorEditorPreviousColor}"/>
                                    </ToolTipService.ToolTip>
                                </Border>
                            </Grid>
                            <Grid Grid.Column="1" x:Name="HuePadGrid" RowSpan="2" Width="36">
                                <Rectangle Fill="{StaticResource HueBrush}"/>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <pad:Pad x:Name="HuePad" MovementDirection="Y">
                                        <Grid Width="36" Height="36" Margin="0 -15">
                                            <Path Data="M0,4 L36,4 L36,6 L0,6z M0,0 L36,0 L36,2 L0,2 z" Fill="White" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                        </Grid>
                                    </pad:Pad>
                                </Border>
                            </Grid>
                            <Grid Grid.Column="1" x:Name="LuminancePadGrid" RowSpan="2" Width="36">
                                <Rectangle Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedColor, Converter={StaticResource ColorToHSColorBrushConverter}}"/>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <Rectangle Fill="{StaticResource ZeroToWhiteBrush}"/>
                                    <Rectangle Fill="{StaticResource ZeroToBlackBrush}" Grid.Row="1"/>
                                </Grid>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <pad:Pad x:Name="LuminancePad" MovementDirection="Y">
                                        <Grid Width="36" Height="36" Margin="0 -15">
                                            <Path Data="M0,4 L36,4 L36,6 L0,6z M0,0 L36,0 L36,2 L0,2 z" Fill="White" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                        </Grid>
                                    </pad:Pad>
                                </Border>
                            </Grid>
                            <Grid Grid.Column="2" x:Name="ColorModesGrid" Margin="3 0 0 0" Width="220">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <telerikInput:RadComboBox
                                        IsEditable="True"
                                        IsReadOnly="True"
                                        ItemsSource="{Binding Source={StaticResource ColorModeCollection}}"
                                        FontSize="{TemplateBinding FontSize}"
                                        SelectedIndex="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ColorMode, Mode=TwoWay, Converter={StaticResource EnumConverter}}"
                                        HorizontalAlignment="Stretch"
                                        Margin="0 0 0 15"
                                        MinHeight="0"
                                        Padding="5 8"/>
                                <Grid x:Name="RgbTemplate" Grid.Row="1" Visibility="Collapsed">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20"/>
                                        <ColumnDefinition Width="64"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                            Text="R"
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="G"
                                            Grid.Row="1"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="B"
                                            Grid.Row="2"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="0"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Rgba.Red, Mode=TwoWay, FallbackValue=0}"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:n0}"
                                            Mask="#3"
                                            HorizontalAlignment="Stretch"
                                            UpdateValueEvent="LostFocus"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="1"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Rgba.Green, Mode=TwoWay, FallbackValue=0}"
                                            Mask="#3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:n0}"
                                            HorizontalAlignment="Stretch"
                                            UpdateValueEvent="LostFocus"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="2"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Rgba.Blue, Mode=TwoWay, FallbackValue=0}"
                                            Mask="#3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:n0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="RgbSliderRed"
                                            Maximum="255"
                                            SmallChange="1"
                                            LargeChange="1"
                                            Grid.Row="0"
                                            Grid.Column="2"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Rgba.Red, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="RgbSliderGreen"
                                            Maximum="255"
                                            SmallChange="1"
                                            LargeChange="1"
                                            Grid.Row="1"
                                            Grid.Column="2"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Rgba.Green, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="RgbSliderBlue"
                                            Maximum="255"
                                            SmallChange="1"
                                            LargeChange="1"
                                            Grid.Row="2"
                                            Grid.Column="2"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Rgba.Blue, Mode=TwoWay}"/>
                                </Grid>
                                <Grid x:Name="HlsTemplate" Grid.Row="1" Visibility="Collapsed">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20"/>
                                        <ColumnDefinition Width="64"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                            Text="H"
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="L"
                                            Grid.Row="1"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="S"
                                            Grid.Row="2"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="0"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hlsa.Hue, Mode=TwoWay, FallbackValue=0}"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:n0}°"
                                            Mask="#3°"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="1"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hlsa.Luminance, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="2"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hlsa.Saturation, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="HlsSliderHue"
                                            Grid.Row="0"
                                            Grid.Column="2"
                                            Maximum="360"
                                            SmallChange="1"
                                            LargeChange="1"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hlsa.Hue, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="HlsSliderLuminance"
                                            Grid.Row="1"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hlsa.Luminance, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="HlsSliderSaturation"
                                            Grid.Row="2"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hlsa.Saturation, Mode=TwoWay}"/>
                                </Grid>
                                <Grid x:Name="HsvTemplate" Grid.Row="1" Visibility="Collapsed">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20"/>
                                        <ColumnDefinition Width="64"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                            Text="H"
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="S"
                                            Grid.Row="1"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="V"
                                            Grid.Row="2"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="0"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hsva.Hue, Mode=TwoWay, FallbackValue=0}"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:n0}°"
                                            Mask="#3°"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            BorderThickness="0"
                                            HorizontalContentAlignment="Left"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="1"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hsva.Saturation, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            BorderThickness="0"
                                            HorizontalContentAlignment="Left"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="2"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hsva.Value, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            BorderThickness="0"
                                            HorizontalContentAlignment="Left"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="HsvSliderHue"
                                            Grid.Row="0"
                                            Grid.Column="2"
                                            Maximum="360"
                                            SmallChange="1"
                                            LargeChange="1"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hsva.Hue, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="HsvSliderSaturation"
                                            Grid.Row="1"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hsva.Saturation, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="HsvSliderValue"
                                            Grid.Row="2"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hsva.Value, Mode=TwoWay}"/>
                                </Grid>
                                <Grid x:Name="CmykTemplate" Grid.Row="1" Visibility="Collapsed">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20"/>
                                        <ColumnDefinition Width="64"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                            Text="C"
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="M"
                                            Grid.Row="1"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="Y"
                                            Grid.Row="2"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBlock
                                            Text="K"
                                            Grid.Row="3"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="0"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Cyan, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="1"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Magenta, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Row="2"
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Yellow, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            FontSize="{TemplateBinding FontSize}"
                                            Grid.Row="3"
                                            Grid.Column="1"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Key, Mode=TwoWay, FallbackValue=0}"
                                            Mask="p3"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="CmykSliderCyan"
                                            Grid.Row="0"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Cyan, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="CmykSliderMagenta"
                                            Grid.Row="1"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Magenta, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="CmykSliderYellow"
                                            Grid.Row="2"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Yellow, Mode=TwoWay}"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="CmykSliderKey"
                                            Grid.Row="3"
                                            Grid.Column="2"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Cmyka.Key, Mode=TwoWay}"/>
                                </Grid>
                                <Grid Grid.Row="2" Visibility="{TemplateBinding AlphaSettingsVisibility}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="19"/>
                                        <ColumnDefinition Width="65"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                            Text="A"
                                            Grid.Column="0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <telerikInput:RadMaskedNumericInput
                                            Grid.Column="1"
                                            FontSize="{TemplateBinding FontSize}"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.SelectedColorViewModel.Alpha, Mode=TwoWay, FallbackValue=0}"
                                            IsClearButtonVisible="False"
                                            FormatString="{}{0:p0}"
                                            Mask="p3"
                                            HorizontalAlignment="Stretch"
                                            maskedInput:MaskedInputExtensions.AllowNull="False"
                                            UpdateValueEvent="LostFocus"
                                            HorizontalContentAlignment="Left"
                                            BorderThickness="0"/>
                                    <telerik:RadSlider
                                            IsMoveToPointEnabled="True"
                                            x:Name="SliderAlpha"
                                            SmallChange="0.01"
                                            LargeChange="0.01"
                                            Grid.Row="0"
                                            Grid.Column="2"
                                            VerticalAlignment="Center"
                                            Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.SelectedColorViewModel.Alpha, Mode=TwoWay}"/>
                                </Grid>
                                <Grid Grid.Row="3" Margin="0 10 0 0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="24"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                            Text="#"
                                            Grid.Column="0"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Center"
                                            FontSize="{TemplateBinding FontSize}"
                                            Foreground="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"
                                            Margin="5 0 0 0"/>
                                    <TextBox
                                            Grid.Column="1"
                                            colorEditorHelpers:TextBoxHelper.UpdateTextBindingOnKeyPress="True"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=ViewModel.Hex.Value, Mode=TwoWay}"
                                            FontSize="{TemplateBinding FontSize}"
                                            Margin="5 3 0 0"/>
                                </Grid>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style BasedOn="{StaticResource PadStyle}" TargetType="pad:Pad"/>
    <Style TargetType="telerikInput:RadColorEditor" BasedOn="{StaticResource RadColorEditorStyle}"/>
    <Style x:Key="CalendarButtonStyle" TargetType="calendar:CalendarButton">
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinWidth" Value="40"/>
        <Setter Property="MinHeight" Value="40"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="calendar:CalendarButton">
                    <Grid x:Name="LayoutRoot" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To="0.3"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="IsInAnotherView"/>
                                <VisualState x:Name="IsNotFromCurrentView">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ButtonType">
                                <VisualState x:Name="Year"/>
                                <VisualState x:Name="Decade"/>
                                <VisualState x:Name="Date"/>
                                <VisualState x:Name="WeekName">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(ContentControl.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=HighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="WeekNumber">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(ContentControl.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TodayDate">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TodayVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Month"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundVisual" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(ContentControl.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=InvertedForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="BackgroundVisual"
                                Visibility="Visible"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Margin="{StaticResource CalendarButtonMargin}"/>
                        <Border x:Name="MouseOverVisual"
                                Visibility="Collapsed"
                                Opacity="0.05"
                                Background="{telerik:Windows8TouchResource ResourceKey=InvertedBrush}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="FocusVisual" Visibility="Collapsed" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="TodayVisual"
                                Visibility="Collapsed"
                                Background="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <ContentControl x:Name="Content"
                                Margin="{TemplateBinding Padding}"
                                Foreground="{TemplateBinding Foreground}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                FontSize="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"
                                FontFamily="{TemplateBinding FontFamily}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                IsTabStop="False"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="calendar:CalendarButton" BasedOn="{StaticResource CalendarButtonStyle}"/>
    <Style TargetType="calendar:CalendarView" x:Key="CalendarViewStyle">
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSize}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource CalendarViewBorderThickness}"/>
        <Setter Property="Padding" Value="{StaticResource CalendarViewHeaderPadding}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="calendar:CalendarView">
                    <Grid Margin="{StaticResource CalendarViewMargin}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border x:Name="BackgroundVisual" Grid.RowSpan="2" Background="{TemplateBinding Background}"/>
                        <Border x:Name="Header"
                                Visibility="{TemplateBinding HeaderVisibility}"
                                Margin="{StaticResource CalendarViewHeaderMargin}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentPresenter
                                    Content="{TemplateBinding Header}"
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    Margin="{TemplateBinding Padding}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ItemsPresenter Grid.Row="1" Margin="{StaticResource CalendarItemsMargin}"/>
                        <Border x:Name="BorderBrush" Grid.RowSpan="2" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"/>
                        <Rectangle x:Name="MinDesiredSize" Grid.Row="1" Width="340" Height="300"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Margin" Value="0"/>
    </Style>
    <Style x:Key="MonthViewStyle" TargetType="calendar:CalendarView">
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSize}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource CalendarViewBorderThickness}"/>
        <Setter Property="Padding" Value="{StaticResource CalendarViewHeaderPadding}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="calendar:CalendarView">
                    <Grid Margin="{StaticResource CalendarViewMargin}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border x:Name="BackgroundVisual" Grid.RowSpan="2" Background="{TemplateBinding Background}"/>
                        <Border x:Name="Header"
                                Visibility="{TemplateBinding HeaderVisibility}"
                                Margin="{StaticResource CalendarViewHeaderMargin}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentPresenter
                                    Content="{TemplateBinding Header}"
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    Margin="{TemplateBinding Padding}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <Grid x:Name="WeekHeaders" Grid.Row="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="6*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="7*"/>
                            </Grid.ColumnDefinitions>
                            <Border x:Name="VerticalOuterBorder"
                                    Grid.RowSpan="2"
                                    Canvas.ZIndex="{StaticResource CalendarWeekHeaderVerticalOuterBorderZIndex}"
                                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"
                                    BorderThickness="{StaticResource CalendarWeekHeaderVerticalOuterBorderThickness}"
                                    Margin="{StaticResource CalendarWeekHeaderVerticalOuterBorderMargin}"
                                    Visibility="{Binding Path=HideColumn, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InvertedBooleanToVisibilityConverterInstance}}"/>
                            <Rectangle x:Name="VerticalBackground"
                                    Grid.RowSpan="2"
                                    Canvas.ZIndex="{StaticResource CalendarWeekHeaderVerticalBackgroundZIndex}"
                                    Fill="{telerik:Windows8TouchResource ResourceKey=MainBrush}"
                                    Margin="{StaticResource CalendarWeekHeaderVerticalBackgroundMargin}"
                                    Visibility="{Binding Path=HideColumn, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InvertedBooleanToVisibilityConverterInstance}}"/>
                            <Rectangle x:Name="HorizontalBackground"
                                    Grid.ColumnSpan="2"
                                    Canvas.ZIndex="{StaticResource CalendarWeekHeaderHorizontalBackgroundZIndex}"
                                    Fill="Transparent"
                                    Margin="{StaticResource CalendarWeekHeaderHorizontalBackgroundMargin}"
                                    Visibility="{Binding Path=HideRow, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InvertedBooleanToVisibilityConverterInstance}}"/>
                        </Grid>
                        <ItemsPresenter Grid.Row="1" Margin="{StaticResource CalendarItemsMargin}"/>
                        <Border x:Name="BorderBrush" Grid.RowSpan="2" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"/>
                        <Rectangle x:Name="MinDesiredSize" Grid.Row="1" Width="340" Height="300"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Margin" Value="0"/>
    </Style>
    <Style TargetType="calendar:CalendarView" BasedOn="{StaticResource MonthViewStyle}"/>
    <Style x:Key="MoveLeftButtonStyle" TargetType="RepeatButton">
        <Setter Property="Width" Value="36"/>
        <Setter Property="Height" Value="36"/>
        <Setter Property="Margin" Value="10 3"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconPressed" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="Transparent"/>
                        <Grid Margin="3">
                            <Path x:Name="Icon"
                                    Data="M15,1.9999999 C7.8202982,2 2,7.8202982 1.9999999,15 C2,22.179701 7.8202982,28 15,28 C22.179701,28 28,22.179701 28,15 C28,7.8202982 22.179701,2 15,1.9999999 z M15,0 C23.284271,0 30,6.7157288 30,15 C30,23.284271 23.284271,30 15,30 C6.7157288,30 0,23.284271 0,15 C0,6.7157288 6.7157288,0 15,0 z M18.935978,9.0009766 L18.991982,20.918976 L9.0319824,14.988217 z"
                                    Fill="{telerik:Windows8TouchResource ResourceKey=InvertedBrush}"
                                    Stretch="Fill"/>
                            <Path x:Name="IconPressed"
                                    Data="M18.999268,9.0019007 L9.1100416,14.979577 L19.033043,20.8929 z M15,0 C23.284271,0 30,6.7157288 30,15 C30,23.284271 23.284271,30 15,30 C6.7157288,30 0,23.284271 0,15 C0,6.7157288 6.7157288,0 15,0 z"
                                    Fill="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                                    Stretch="Fill"
                                    Visibility="Collapsed"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="MoveRightButtonStyle" TargetType="RepeatButton">
        <Setter Property="Width" Value="36"/>
        <Setter Property="Height" Value="36"/>
        <Setter Property="Margin" Value="10 3"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Icon" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconPressed" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="Transparent"/>
                        <Grid Margin="3">
                            <Path x:Name="Icon"
                                    Data="M15,1.9999999 C7.8202982,2 2,7.8202982 1.9999999,15 C2,22.179701 7.8202982,28 15,28 C22.179701,28 28,22.179701 28,15 C28,7.8202982 22.179701,2 15,1.9999999 z M15,0 C23.284271,0 30,6.7157288 30,15 C30,23.284271 23.284271,30 15,30 C6.7157288,30 0,23.284271 0,15 C0,6.7157288 6.7157288,0 15,0 z M20.875036,15.000235 L10.998036,8.9379883 L10.998036,20.937988 z"
                                    Fill="{telerik:Windows8TouchResource ResourceKey=InvertedBrush}"
                                    Stretch="Fill"/>
                            <Path x:Name="IconPressed"
                                    Data="M11.041961,9.3539915 L11.08301,21.311991 L20.855961,15.436995 z M15,0 C23.284271,0 30,6.7157288 30,15 C30,23.284271 23.284271,30 15,30 C6.7157288,30 0,23.284271 0,15 C0,6.7157288 6.7157288,0 15,0 z"
                                    Fill="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                                    Stretch="Fill"
                                    Visibility="Collapsed"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CalendarHeaderButton" TargetType="Button">
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeXL}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="LayoutRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To="0.75"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="TextDecorations">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HeaderButtonTextDecoration}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="TextDecorations">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HeaderButtonTextDecoration}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="TextDecorations">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HeaderButtonTextDecoration}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <TextBlock x:Name="Text" Text="{TemplateBinding Content}" Margin="0 1 0 1" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadCalendarStyle" TargetType="telerikInput:RadCalendar">
        <Setter Property="Columns" Value="1"/>
        <Setter Property="Rows" Value="1"/>
        <Setter Property="MonthViewStyle" Value="{StaticResource MonthViewStyle}"/>
        <Setter Property="YearViewStyle" Value="{StaticResource CalendarViewStyle}"/>
        <Setter Property="DecadeViewStyle" Value="{StaticResource CalendarViewStyle}"/>
        <Setter Property="CenturyViewStyle" Value="{StaticResource CalendarViewStyle}"/>
        <Setter Property="DayButtonStyle" Value="{StaticResource CalendarButtonStyle}"/>
        <Setter Property="MonthButtonStyle" Value="{StaticResource CalendarButtonStyle}"/>
        <Setter Property="YearButtonStyle" Value="{StaticResource CalendarButtonStyle}"/>
        <Setter Property="DecadeButtonStyle" Value="{StaticResource CalendarButtonStyle}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="{StaticResource CalendarHeaderPadding}"/>
        <Setter Property="ViewsHeaderVisibility" Value="Collapsed"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="True"/>
        <Setter Property="TabIndex" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadCalendar">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="49"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border x:Name="Background" Grid.RowSpan="2" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <calendar:TransitionPanel x:Name="TransitionPanel" Grid.Row="1" ClipToBounds="True" Margin="{StaticResource CalendarTransitionPanelMargin}">
                            <primitives:RadUniformGrid x:Name="MonthViews" Margin="1 1 0 0" Rows="{TemplateBinding Rows}" Columns="{TemplateBinding Columns}"/>
                            <primitives:RadUniformGrid x:Name="YearViews" Margin="1 1 0 0" Rows="{TemplateBinding Rows}" Columns="{TemplateBinding Columns}" Visibility="Collapsed"/>
                            <primitives:RadUniformGrid x:Name="DecadeViews" Margin="1 1 0 0" Rows="{TemplateBinding Rows}" Columns="{TemplateBinding Columns}" Visibility="Collapsed"/>
                            <primitives:RadUniformGrid x:Name="CenturyViews" Margin="1 1 0 0" Rows="{TemplateBinding Rows}" Columns="{TemplateBinding Columns}" Visibility="Collapsed"/>
                        </calendar:TransitionPanel>
                        <Border x:Name="OuterBorder" Grid.RowSpan="2" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"/>
                        <Border x:Name="Navigation" Margin="1" Canvas.ZIndex="2" Visibility="{TemplateBinding HeaderVisibility}" Background="{telerik:Windows8TouchResource ResourceKey=LowBrush}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <RepeatButton x:Name="MoveLeft" Grid.Column="0" Style="{StaticResource MoveLeftButtonStyle}"/>
                                <Button x:Name="Header" Grid.Column="1" Style="{StaticResource CalendarHeaderButton}"/>
                                <RepeatButton x:Name="MoveRight" Grid.Column="2" Style="{StaticResource MoveRightButtonStyle}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="MonthViewPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <calendar:CalendarPanel PreserveSpaceForCollapsedChildren="True" FirstColumn="1" VerticalAlignment="Stretch" Rows="7" Columns="8"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="YearViewPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <calendar:CalendarPanel PreserveSpaceForCollapsedChildren="True" VerticalAlignment="Stretch" Rows="3" Columns="4"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="DecadeViewPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <calendar:CalendarPanel PreserveSpaceForCollapsedChildren="True" VerticalAlignment="Stretch" Rows="3" Columns="4"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="CenturyViewPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <calendar:CalendarPanel PreserveSpaceForCollapsedChildren="True" VerticalAlignment="Stretch" Rows="3" Columns="4"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikInput:RadCalendar" BasedOn="{StaticResource RadCalendarStyle}"/>
    <Style x:Key="RadClockItemStyle" TargetType="telerikInput:RadClockItem">
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="{StaticResource ClockItemPadding}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadClockItem">
                    <Grid x:Name="LayoutRoot" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundBorder" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="(ContentControl.Foreground)">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{telerik:Windows8TouchResource ResourceKey=InvertedForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="BackgroundBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="MouseOverVisual"
                                Background="{telerik:Windows8TouchResource ResourceKey=InvertedBrush}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Visibility="Collapsed"
                                Opacity="0.05"/>
                        <ContentControl x:Name="Content"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Margin="{TemplateBinding Padding}"
                                Foreground="{TemplateBinding Foreground}"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikInput:RadClockItem" BasedOn="{StaticResource RadClockItemStyle}"/>
    <Style TargetType="telerikInput:RadClock" x:Key="RadClockStyle">
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="{StaticResource CalendarHeaderPadding}"/>
        <Setter Property="StartTime" Value="0:0:0"/>
        <Setter Property="EndTime" Value="23:59:0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="True"/>
        <Setter Property="TabIndex" Value="1"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <primitives:RadUniformGrid x:Name="uniformGrid" Columns="4"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock x:Name="ContentText" Text="{Binding}" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadClock">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="48"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border x:Name="BackgroundVisual"
                                Grid.RowSpan="2"
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"/>
                        <Border x:Name="Header" Margin="1 1 1 0" Background="{telerik:Windows8TouchResource ResourceKey=LowBrush}">
                            <ContentControl
                                    Foreground="{TemplateBinding Foreground}"
                                    FontFamily="{TemplateBinding FontFamily}"
                                    FontSize="{telerik:Windows8TouchResource ResourceKey=FontSizeXL}"
                                    IsTabStop="False"
                                    Content="{TemplateBinding Header}"
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    Margin="{TemplateBinding Padding}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ItemsPresenter Grid.Row="1" Margin="{StaticResource ClockItemsMargin}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikInput:RadClock" BasedOn="{StaticResource RadClockStyle}"/>
    <DataTemplate x:Key="WatermarkTemplate">
        <TextBlock Opacity="1" Text="{Binding}"/>
    </DataTemplate>
    <DataTemplate x:Key="TooltipTemplate">
        <Border Margin="2">
            <Border
                    Margin="-3"
                    Background="{telerik:Windows8TouchResource ResourceKey=MainBrush}"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                    BorderThickness="2">
                <ContentControl Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="5 2" Content="{Binding}"/>
            </Border>
        </Border>
    </DataTemplate>
    <Style TargetType="telerikInput:RadDateTimePicker" x:Key="RadDateTimePickerStyle">
        <Setter Property="CalendarStyle" Value="{StaticResource RadCalendarStyle}"/>
        <Setter Property="ClockStyle" Value="{StaticResource RadClockStyle}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="10 0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="DateTimeWatermarkTemplate" Value="{StaticResource WatermarkTemplate}"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once"/>
        <Setter Property="KeyboardNavigation.ControlTabNavigation" Value="Cycle"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
        <Setter Property="TooltipTemplate" Value="{StaticResource TooltipTemplate}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadDateTimePicker">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundVisual" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=HighBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundVisual" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusButtonVisual" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="InputTypeStates">
                                <VisualState x:Name="DateTimePicker">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TodayButtonBorder" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 0 0 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Clock" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0 1 1 1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DateTimePickerIcon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DatePicker">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Clock" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonContainer" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CalendarIcon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TimePicker">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Calendar" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CloseButtonContainer" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ClockIcon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TodayButtonBorder" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Int32>1</sys:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="BackgroundVisual"
                                Grid.ColumnSpan="2"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <telerik:RadWatermarkTextBox x:Name="PART_DateTimeInput"
                                Grid.Column="0"
                                Text="{Binding DateTimeText, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                CurrentText="{Binding CurrentDateTimeText, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                IsReadOnly="{TemplateBinding IsReadOnly}"
                                Foreground="{TemplateBinding Foreground}"
                                VerticalAlignment="Stretch"
                                Padding="{TemplateBinding Padding}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                Background="{x:Null}"
                                BorderBrush="{x:Null}"
                                BorderThickness="0"
                                MinHeight="0"
                                Margin="{TemplateBinding BorderThickness}"
                                WatermarkContent="{TemplateBinding DateTimeWatermarkContent}"
                                WatermarkTemplate="{TemplateBinding DateTimeWatermarkTemplate}"
                                TextAlignment="{TemplateBinding TextAlignment}"
                                TabIndex="0"
                                SelectionOnFocus="{TemplateBinding SelectionOnFocus}"
                                FontSize="{TemplateBinding FontSize}"/>
                        <Border x:Name="DisabledVisual"
                                Visibility="Collapsed"
                                Grid.Column="1"
                                IsHitTestVisible="False"
                                MinHeight="{TemplateBinding MinHeight}"
                                BorderBrush="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <telerik:RadDropDownButton
                                Grid.Column="1"
                                TabIndex="1"
                                Margin="2"
                                Padding="0"
                                DropDownIndicatorVisibility="Collapsed"
                                x:Name="PART_DropDownButton"
                                PopupPlacementTarget="{Binding ElementName=PART_DateTimeInput}"
                                IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                CloseOnEnter="True"
                                IsTabStop="False"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                telerikInput:DateTimePickerExtensions.FocusContentOnOpen="True"
                                Focusable="False">
                            <telerik:RadDropDownButton.DropDownContent>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <telerikInput:RadCalendar x:Name="PART_Calendar"
                                            Grid.Column="0"
                                            Grid.Row="0"
                                            IsReadOnly="{TemplateBinding IsReadOnly}"
                                            DateSelectionMode="{TemplateBinding DateSelectionMode}"
                                            Culture="{TemplateBinding Culture}"
                                            SelectionMode="Single"
                                            Style="{TemplateBinding CalendarStyle}"
                                            DisplayDateStart="{Binding DisplayDateStart, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                            DisplayDate="{Binding DisplayDate, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                            DisplayDateEnd="{Binding DisplayDateEnd, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                            SelectableDateStart="{Binding SelectableDateStart, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                            SelectedDate="{Binding SelectedDate, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                            SelectableDateEnd="{Binding SelectableDateEnd, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                            BlackoutDates="{Binding BlackoutDates, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"/>
                                    <telerikInput:DateTimePickerClock x:Name="PART_Clock"
                                            Grid.Column="1"
                                            Grid.Row="0"
                                            BorderThickness="{TemplateBinding BorderThickness}"
                                            ItemsSource="{TemplateBinding ClockItemsSource}"
                                            StartTime="{TemplateBinding StartTime}"
                                            EndTime="{TemplateBinding EndTime}"
                                            TimeInterval="{Binding TimeInterval, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                            IsReadOnly="{TemplateBinding IsReadOnly}"
                                            Style="{TemplateBinding ClockStyle}"
                                            Culture="{TemplateBinding Culture}"
                                            SelectedItem="{Binding SelectedTime, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                    <Border x:Name="CloseButtonContainer"
                                            Grid.ColumnSpan="2"
                                            Grid.Row="1"
                                            telerik:TouchManager.TouchMode="None"
                                            Background="{TemplateBinding Background}"
                                            BorderThickness="1 0 1 1"
                                            BorderBrush="{TemplateBinding BorderBrush}">
                                        <telerik:RadToggleButton x:Name="PART_Close"
                                                IsBackgroundVisible="False"
                                                TabIndex="2"
                                                IsTabStop="True"
                                                HorizontalAlignment="Right"
                                                Padding="10 8"
                                                Margin="8 9 8 10"
                                                IsThreeState="False"
                                                telerik:LocalizationManager.ResourceKey="Close"
                                                IsChecked="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                                FocusVisualStyle="{x:Null}"
                                                KeyboardNavigation.TabNavigation="Once"/>
                                    </Border>
                                    <Border x:Name="TodayButtonBorder"
                                            BorderThickness="1 0 1 1"
                                            Background="{TemplateBinding Background}"
                                            BorderBrush="{TemplateBinding BorderBrush}"
                                            Grid.Row="1"
                                            Visibility="{TemplateBinding TodayButtonVisibility}">
                                        <telerik:RadButton x:Name="TodayButton"
                                                Command="{x:Static telerik:RadDateTimePickerCommands.SetToday}"
                                                Margin="8 9 8 10"
                                                Padding="10 8"
                                                Background="{telerik:Windows8TouchResource ResourceKey=MainBrush}"
                                                Content="{TemplateBinding TodayButtonContent}"/>
                                    </Border>
                                </Grid>
                            </telerik:RadDropDownButton.DropDownContent>
                            <telerik:RadDropDownButton.Template>
                                <ControlTemplate TargetType="telerik:RadDropDownButton">
                                    <Grid>
                                        <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                        <Popup x:Name="DropDownPopup"
                                                Margin="0 1"
                                                AllowsTransparency="True"
                                                StaysOpen="False"
                                                Focusable="false"
                                                Placement="Bottom"
                                                IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}">
                                            <ContentPresenter x:Name="DropDownPopupContent"
                                                    Content="{TemplateBinding DropDownContent}"
                                                    ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                                    DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                                        </Popup>
                                    </Grid>
                                </ControlTemplate>
                            </telerik:RadDropDownButton.Template>
                            <Grid>
                                <Border Background="Transparent" Visibility="{Binding IsReadOnly, ElementName=PART_DateTimeInput, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"/>
                                <Grid x:Name="DropDownIcon" Background="{StaticResource TransparentBrush}">
                                    <Border x:Name="DateTimePickerIcon" Visibility="Collapsed" Padding="{TemplateBinding Padding}">
                                        <Path
                                                Data="M6,6 L8,6 L8,8 L6,8 z M3,6 L5,6 L5,8 L3,8 z M0,6 L2,6 L2,8 L0,8 z M6,3 L8,3 L8,5 L6,5 z M3,3 L5,3 L5,5 L3,5 z M0,3 L2,3 L2,5 L0,5 z M6,0 L8,0 L8,2 L6,2 z M3,0 L5,0 L5,2 L3,2 z M0,0 L2,0 L2,2 L0,2 z"
                                                Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                                                Stretch="Fill"
                                                Height="16"
                                                Width="16"/>
                                    </Border>
                                    <Border x:Name="CalendarIcon" Visibility="Collapsed" Padding="{TemplateBinding Padding}">
                                        <Path
                                                Data="M188,502L188,481.207C188,480.257,188.771,479.484,189.723,479.484L190.473,479.484L190.473,484.786L197.551,484.786L197.551,479.484L202.568,479.484L202.568,484.786L209.645,484.786L209.645,479.484L210.516,479.484C211.465,479.484,212.237,480.257,212.237,481.207L212.237,502C212.237,502.949,211.465,503.722,210.516,503.722L189.723,503.722C188.771,503.722,188,502.949,188,502 M209.746,487.307L190.503,487.307L190.503,501.544L209.746,501.544z M198.362,499.882L198.186,499.779C197.602,499.439,197.403,498.687,197.744,498.102L201.192,492.208L197.258,492.208C196.581,492.208,196.031,491.658,196.031,490.98L196.031,490.777C196.031,490.102,196.581,489.551,197.258,489.551L203.483,489.551C204.107,489.551,204.623,490.02,204.7,490.623C204.813,490.949,204.788,491.32,204.602,491.643L200.04,499.441C199.699,500.025,198.947,500.223,198.362,499.882 M192.369,482.613L192.369,477.786C192.354,477.697,192.348,477.607,192.348,477.514C192.348,476.605,193.085,475.867,193.994,475.867C194.885,475.867,195.611,476.578,195.639,477.461L195.654,477.461L195.654,482.613z M204.465,482.613L204.463,477.857C204.439,477.747,204.428,477.632,204.428,477.514C204.428,476.605,205.166,475.867,206.075,475.867C206.965,475.867,207.692,476.578,207.721,477.461L207.749,477.461L207.749,482.613z"
                                                Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                                                Stretch="Fill"
                                                Width="14"
                                                Height="16"/>
                                    </Border>
                                    <Border x:Name="ClockIcon" Visibility="Collapsed" Padding="{TemplateBinding Padding}">
                                        <Path
                                                Data="M242.8872,490.2793C242.8872,482.4003,249.2902,476.0093,257.1692,476.0093C265.0472,476.0093,271.4382,482.4003,271.4382,490.2793C271.4382,498.1563,265.0472,504.5603,257.1692,504.5603C249.2902,504.5603,242.8872,498.1563,242.8872,490.2793 M268.6582,490.2793C268.6582,483.9383,263.5082,478.7913,257.1692,478.7913C250.8172,478.7913,245.6672,483.9383,245.6672,490.2793C245.6672,496.6323,250.8172,501.7793,257.1692,501.7793C263.5082,501.7793,268.6582,496.6323,268.6582,490.2793 M256.0822,498.9843C256.0822,498.3773,256.5752,497.8733,257.1952,497.8733C257.8032,497.8733,258.2942,498.3773,258.2942,498.9843C258.2942,499.5933,257.8032,500.0983,257.1952,500.0983C256.5752,500.0983,256.0822,499.5933,256.0822,498.9843 M256.0322,493.4883L256.0322,491.6363L254.3232,491.6363L254.3232,489.3343L256.0322,489.3343L256.0322,480.5373L256.0822,480.5373C256.0822,479.9283,256.5752,479.4363,257.1952,479.4363C257.8032,479.4363,258.2942,479.9283,258.2942,480.5373L258.3332,480.5373L258.3332,489.3343L263.0552,489.3343L263.0552,491.6363L258.3332,491.6363L258.3332,493.4883z M247.6352,490.4473C247.6352,489.8383,248.1392,489.3463,248.7462,489.3463C249.3542,489.3463,249.8462,489.8383,249.8462,490.4473C249.8462,491.0553,249.3542,491.5593,248.7462,491.5593C248.1392,491.5593,247.6352,491.0553,247.6352,490.4473 M264.6982,490.4473C264.6982,489.8383,265.1902,489.3463,265.7972,489.3463C266.4062,489.3463,266.9112,489.8383,266.9112,490.4473C266.9112,491.0553,266.4062,491.5593,265.7972,491.5593C265.1902,491.5593,264.6982,491.0553,264.6982,490.4473"
                                                Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                                                Stretch="Fill"
                                                Width="16"
                                                Height="16"/>
                                    </Border>
                                </Grid>
                            </Grid>
                        </telerik:RadDropDownButton>
                        <Border x:Name="FocusButtonVisual"
                                Opacity="0"
                                Grid.Column="1"
                                IsHitTestVisible="False"
                                MinHeight="{TemplateBinding MinHeight}"
                                Background="{x:Null}"
                                BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="FocusVisual"
                                Opacity="0"
                                Grid.ColumnSpan="2"
                                IsHitTestVisible="False"
                                MinHeight="{TemplateBinding MinHeight}"
                                Background="{x:Null}"
                                BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Popup x:Name="PART_InputPopup"
                                Margin="0 1"
                                telerik:PopupExtensions.IsOpen="{Binding IsTooltipOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                telerik:PopupExtensions.Placement="Top"
                                VerticalOffset="-2"
                                HorizontalOffset="-1"
                                telerik:PopupExtensions.PlacementTarget="{Binding ElementName=PART_DateTimeInput}"
                                telerik:PopupExtensions.Owner="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                StaysOpen="False"
                                AllowsTransparency="True">
                            <ContentPresenter Content="{TemplateBinding TooltipContent}" ContentTemplate="{TemplateBinding TooltipTemplate}"/>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikInput:RadDateTimePicker" BasedOn="{StaticResource RadDateTimePickerStyle}"/>
    <Style TargetType="telerikInput:RadDatePicker" BasedOn="{StaticResource RadDateTimePickerStyle}">
        <Setter Property="InputMode" Value="DatePicker"/>
    </Style>
    <Style TargetType="telerikInput:RadTimePicker" BasedOn="{StaticResource RadDateTimePickerStyle}">
        <Setter Property="InputMode" Value="TimePicker"/>
    </Style>
    <ControlTemplate x:Key="IncreaseRepeatButtonControlTemplate" TargetType="RepeatButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation To="0.5" Duration="0" Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Root"
                    MinWidth="14"
                    MinHeight="9"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <Rectangle x:Name="FocusVisual" Grid.RowSpan="2" Grid.ColumnSpan="2" StrokeThickness="0" Stroke="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Visibility="Collapsed"/>
            <Path x:Name="Icon"
                    Data="M7.1791806,0 L11.037181,0 L11.037181,7.0529909 L17.976999,7.0529909 L17.976999,10.906991 L11.037181,10.906991 L11.037181,17.957001 L7.1791806,17.957001 L7.1791806,10.906991 L0,10.906991 L0,7.0529909 L7.1791806,7.0529909 z"
                    Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                    Width="9"
                    Height="9"
                    Stretch="Fill"
                    SnapsToDevicePixels="True"/>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="DecreaseRepeatButtonControlTemplate" TargetType="RepeatButton">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation To="0.5" Duration="0" Storyboard.TargetName="Icon" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{telerik:Windows8TouchResource ResourceKey=InvertedGradientBrush}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Root"
                    MinWidth="14"
                    MinHeight="9"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <Rectangle x:Name="FocusVisual" Grid.RowSpan="2" Grid.ColumnSpan="2" StrokeThickness="0" Stroke="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Visibility="Collapsed"/>
            <Rectangle x:Name="Icon" Width="8" Height="2" Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Stroke="{x:Null}" SnapsToDevicePixels="True"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="IncreaseRepeatButtonStyle" TargetType="RepeatButton">
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1 0 0 0"/>
        <Setter Property="MinWidth" Value="36"/>
        <Setter Property="IsEnabled" Value="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InvertedBooleanConverter}}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource IncreaseRepeatButtonControlTemplate}"/>
    </Style>
    <Style x:Key="DecreaseRepeatButtonStyle" TargetType="RepeatButton">
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="0 0 1 0"/>
        <Setter Property="MinWidth" Value="36"/>
        <Setter Property="IsEnabled" Value="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InvertedBooleanConverter}}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource DecreaseRepeatButtonControlTemplate}"/>
    </Style>
    <ControlTemplate x:Key="RadNumericUpDownControlTemplate" TargetType="telerikInput:RadNumericUpDown">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation To="0.5" Duration="0:0:0" Storyboard.TargetName="textbox" Storyboard.TargetProperty="Opacity"/>
                            <DoubleAnimation To="0.5" Duration="0:0:0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation To="1" Duration="0:0:0" Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="MouseOverTextHidden"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusVisualStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ButtonsBehavior">
                    <VisualState x:Name="ShowButtons"/>
                    <VisualState x:Name="HideButtons">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="increase" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="decrease" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="TextBoxBehavior">
                    <VisualState x:Name="ShowTextBox"/>
                    <VisualState x:Name="HideTextBox">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="textbox" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="decrease" Storyboard.TargetProperty="Margin">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Thickness>1 1 -1 1</Thickness>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextColumn" Storyboard.TargetProperty="(ColumnDefinition.Width)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <GridLength>Auto</GridLength>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftButtonsColumn" Storyboard.TargetProperty="(ColumnDefinition.Width)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <GridLength>*</GridLength>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightButtonsColumn" Storyboard.TargetProperty="(ColumnDefinition.Width)">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <GridLength>*</GridLength>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" x:Name="LeftButtonsColumn"/>
                <ColumnDefinition Width="*" x:Name="TextColumn"/>
                <ColumnDefinition Width="Auto" x:Name="RightButtonsColumn"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="Border"
                    Grid.ColumnSpan="3"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"/>
            <Border x:Name="MouseOverVisual"
                    Grid.ColumnSpan="3"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                    Opacity="0"/>
            <Rectangle x:Name="FocusVisual" Grid.ColumnSpan="3" StrokeThickness="1" Stroke="{telerik:Windows8TouchResource ResourceKey=AccentBrush}" Opacity="0"/>
            <TextBox x:Name="textbox"
                    Grid.Column="1"
                    IsReadOnly="{TemplateBinding IsReadOnly}"
                    TabIndex="{TemplateBinding TabIndex}"
                    BorderThickness="0"
                    Padding="{TemplateBinding Padding}"
                    Background="{TemplateBinding Background}"
                    Foreground="{TemplateBinding Foreground}"
                    FontFamily="{TemplateBinding FontFamily}"
                    FontSize="{TemplateBinding FontSize}"
                    VerticalAlignment="Stretch"
                    HorizontalContentAlignment="Stretch"
                    TextAlignment="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=HorizontalContentAlignment, Converter={StaticResource HorizontalContentAlignmentToTextAlignmentConverter}}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                <TextBox.Template>
                    <ControlTemplate TargetType="TextBox">
                        <ScrollViewer
                                Padding="{TemplateBinding Padding}"
                                BorderBrush="Transparent"
                                Background="Transparent"
                                BorderThickness="0"
                                IsTabStop="False"
                                VerticalScrollBarVisibility="Auto"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                x:Name="PART_ContentHost"/>
                    </ControlTemplate>
                </TextBox.Template>
            </TextBox>
            <RepeatButton x:Name="increase" Margin="0 1 1 1" Grid.Column="2" IsTabStop="{TemplateBinding AreButtonsTabStops}" Style="{StaticResource IncreaseRepeatButtonStyle}"/>
            <RepeatButton x:Name="decrease" Margin="1 1 0 1" Grid.Column="0" IsTabStop="{TemplateBinding AreButtonsTabStops}" Style="{StaticResource DecreaseRepeatButtonStyle}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadNumericUpDownStyle" TargetType="telerikInput:RadNumericUpDown">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="10"/>
        <Setter Property="MinWidth" Value="100"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="Template" Value="{StaticResource RadNumericUpDownControlTemplate}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
    </Style>
    <Style TargetType="telerikInput:RadNumericUpDown" BasedOn="{StaticResource RadNumericUpDownStyle}"/>
    <Style x:Key="RadRatingStyle" TargetType="telerikInput:RadRating">
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadRating">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.3" Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard Duration="0">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <ItemsPresenter/>
                        </Border>
                        <Border x:Name="ReadOnlyVisualElement" IsHitTestVisible="False" Opacity="0" Background="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
                        <Rectangle x:Name="FocusVisualElement"
                                IsHitTestVisible="false"
                                Visibility="Collapsed"
                                StrokeThickness="1"
                                Stroke="{telerik1:Windows8TouchResource ResourceKey=InvertedBrush}"
                                Opacity="0.3"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadRatingItemStyle" TargetType="telerikInput:RadRatingItem">
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadRatingItem">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="itemGrid" Storyboard.TargetProperty="Opacity"/>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="SelectedRatingItem" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="SelectedRatingItem" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetName="itemGrid" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FillStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.1000000"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Empty"/>
                                <VisualState x:Name="Partial"/>
                                <VisualState x:Name="Filled"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="itemGrid" Margin="{TemplateBinding Padding}" Background="Transparent">
                            <Path x:Name="NormalRatingItem"
                                    Fill="{TemplateBinding Background}"
                                    Stretch="Uniform"
                                    HorizontalAlignment="Center"
                                    Data="M74,40 L76.5,35 L79,40 L85,41 L80.5,44.5 L81.291664,50 L76.5,47.583332 L71.645836,50 L72.5,44.5 L68,41 z"
                                    Stroke="{TemplateBinding BorderBrush}"
                                    StrokeLineJoin="Round"
                                    VerticalAlignment="Stretch"
                                    StrokeThickness="{TemplateBinding BorderThickness}"
                                    Width="28"
                                    Height="28"
                                    Opacity="1"/>
                            <telerikRating:LinearClipper RatioVisible="{TemplateBinding RatioVisible}" HorizontalContentAlignment="Center" ExpandDirection="Right">
                                <Path x:Name="SelectedRatingItem"
                                        Data="M74,40 L76.5,35 L79,40 L85,41 L80.5,44.5 L81.291664,50 L76.5,47.583332 L71.645836,50 L72.5,44.5 L68,41 z"
                                        Stretch="Uniform"
                                        StrokeThickness="{TemplateBinding BorderThickness}"
                                        StrokeLineJoin="Round"
                                        Opacity="1"
                                        Fill="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                                        Stroke="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                                        Width="28"
                                        Height="28"/>
                            </telerikRating:LinearClipper>
                        </Grid>
                        <ContentPresenter x:Name="Content"
                                Cursor="{TemplateBinding Cursor}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                Grid.Row="1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikInput:RadRating" BasedOn="{StaticResource RadRatingStyle}"/>
    <Style TargetType="telerikInput:RadRatingItem" BasedOn="{StaticResource RadRatingItemStyle}"/>
    <maskedInput:HorizontalContentAlignmentToTextAlignmentConverter x:Key="conv"/>
    <telerik1:BooleanToVisibilityConverter x:Key="boolToVisConverter"/>
    <Style x:Key="MaskedInputTextBoxStyle" TargetType="maskedInput:PreviewInputTextBox">
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="MinHeight" Value="34"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="maskedInput:PreviewInputTextBox">
                    <Grid x:Name="RootElement" Background="Transparent">
                        <ScrollViewer
                                Padding="{TemplateBinding Padding}"
                                Background="Transparent"
                                BorderThickness="0"
                                Foreground="{TemplateBinding Foreground}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                x:Name="PART_ContentHost"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="MaskedInputClearButtonTemplate" TargetType="telerik1:RadButton">
        <Grid x:Name="root" Background="Transparent" SnapsToDevicePixels="True">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0:0:0.3">
                            <VisualTransition.GeneratedEasingFunction>
                                <CircleEase EasingMode="EaseOut"/>
                            </VisualTransition.GeneratedEasingFunction>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pathNormal"/>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pathHover"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pathNormal"/>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pathHover"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="root"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStatesGroup">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Path x:Name="pathNormal"
                    Stretch="None"
                    Fill="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"
                    RenderTransformOrigin="0.5,0.5"
                    Width="14"
                    Height="14"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Data="F1M12.488,5.1L10.967,3.579L8,6.545L5.034,3.579L3.512,5.1L6.479,8.066L3.512,11.033L5.034,12.555L8,9.588L10.967,12.554L12.488,11.033L9.521,8.066z">
                <Path.RenderTransform>
                    <RotateTransform Angle="90"/>
                </Path.RenderTransform>
            </Path>
            <Path x:Name="pathHover"
                    Stretch="None"
                    Fill="{telerik1:Windows8TouchResource ResourceKey=ValidationBrush}"
                    RenderTransformOrigin="0.5,0.5"
                    Width="14"
                    Height="14"
                    Opacity="0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Data="F1M12.488,5.1L10.967,3.579L8,6.545L5.034,3.579L3.512,5.1L6.479,8.066L3.512,11.033L5.034,12.555L8,9.588L10.967,12.554L12.488,11.033L9.521,8.066z">
                <Path.RenderTransform>
                    <RotateTransform Angle="90"/>
                </Path.RenderTransform>
            </Path>
        </Grid>
    </ControlTemplate>
    <Style x:Key="MaskedInputClearButtonStyle" TargetType="telerik1:RadButton">
        <Setter Property="Template" Value="{StaticResource MaskedInputClearButtonTemplate}"/>
        <Setter Property="Width" Value="34"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Cursor" Value="Hand"/>
    </Style>
    <Style TargetType="telerikInput:RadMaskedInputBase" x:Key="RadMaskedInputBaseStyle">
        <Setter Property="Foreground" Value="{telerik1:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="Background" Value="{telerik1:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{telerik1:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="FontSize" Value="{telerik1:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="FontFamily" Value="{telerik1:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="Padding" Value="5 7"/>
        <Setter Property="MinHeight" Value="0"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="MinHeight" Value="22"/>
        <Setter Property="Padding" Value="3 2"/>
        <Setter Property="TextBoxStyle" Value="{StaticResource MaskedInputTextBoxStyle}"/>
        <Setter Property="ClearButtonStyle" Value="{StaticResource MaskedInputClearButtonStyle}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="IsReadOnly" Value="False"/>
        <Setter Property="TextMode" Value="MaskedText"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadMaskedInputBase">
                    <Grid UseLayoutRounding="True" SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="ClearButton" Storyboard.TargetProperty="Opacity" To="0"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush Color="Transparent"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush Color="Transparent"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="EditorSite" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush Color="Transparent"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="DisplayText" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush Color="Transparent"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="EmptyContent" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush Color="Transparent"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" To="0.3"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="ClearButton" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisplayTextContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="EditorSite" Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:00"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusedVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NotFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisplayTextContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="EditorSite" Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:00"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ContentStates">
                                <VisualState x:Name="NotEmpty"/>
                                <VisualState x:Name="Empty">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="DisplayTextContent" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EmptyContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                SnapsToDevicePixels="True">
                            <Grid x:Name="GridContainer">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <maskedInput:PreviewInputTextBox x:Name="EditorSite"
                                        TabIndex="{TemplateBinding TabIndex}"
                                        AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
                                        Cursor="{TemplateBinding Cursor}"
                                        AcceptsReturn="{TemplateBinding AcceptsReturn}"
                                        IsEnabled="{TemplateBinding IsEnabled}"
                                        Background="{TemplateBinding Background}"
                                        Foreground="{TemplateBinding Foreground}"
                                        IsReadOnly="{TemplateBinding IsReadOnly}"
                                        Padding="{TemplateBinding Padding}"
                                        Height="{TemplateBinding Height}"
                                        TextAlignment="{Binding HorizontalContentAlignment, Converter={StaticResource conv}, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                        Style="{TemplateBinding TextBoxStyle}"
                                        FontFamily="{TemplateBinding FontFamily}"
                                        FontSize="{TemplateBinding FontSize}"
                                        FontWeight="{TemplateBinding FontWeight}"/>
                                <Border IsHitTestVisible="False" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" x:Name="DisplayTextContent" Visibility="Collapsed">
                                    <maskedInput:PreviewInputTextBox x:Name="DisplayText"
                                            AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
                                            Cursor="{TemplateBinding Cursor}"
                                            Text="{Binding Path=Text, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=OneWay}"
                                            IsTabStop="False"
                                            Padding="{TemplateBinding Padding}"
                                            IsEnabled="{TemplateBinding IsEnabled}"
                                            Foreground="{TemplateBinding Foreground}"
                                            IsReadOnly="{TemplateBinding IsReadOnly}"
                                            Style="{TemplateBinding TextBoxStyle}"
                                            Height="{TemplateBinding Height}"
                                            TextAlignment="{Binding HorizontalContentAlignment, Converter={StaticResource conv}, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            FontFamily="{TemplateBinding FontFamily}"
                                            FontSize="{TemplateBinding FontSize}"
                                            FontWeight="{TemplateBinding FontWeight}"/>
                                </Border>
                                <Border IsHitTestVisible="False" x:Name="EmptyContent" Visibility="Collapsed" Padding="5 0 0 0">
                                    <ContentControl x:Name="Content"
                                            IsTabStop="False"
                                            Content="{TemplateBinding EmptyContent}"
                                            ContentTemplate="{TemplateBinding EmptyContentTemplate}"
                                            Foreground="{TemplateBinding Foreground}"
                                            Margin="{TemplateBinding Padding}"
                                            FontStyle="Italic"
                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Border>
                                <telerik1:RadButton x:Name="ClearButton"
                                        Command="{TemplateBinding ClearCommand}"
                                        IsTabStop="False"
                                        Style="{TemplateBinding ClearButtonStyle}"
                                        Opacity="0"
                                        Grid.Column="1"
                                        Visibility="{Binding Path=IsClearButtonVisible, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource boolToVisConverter}}"/>
                            </Grid>
                        </Border>
                        <Border x:Name="hover"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{x:Null}"
                                BorderBrush="{telerik1:Windows8TouchResource ResourceKey=InvertedBrush}"
                                Opacity="0"/>
                        <Border x:Name="FocusedVisual" Visibility="Collapsed" BorderThickness="1" Background="{x:Null}" BorderBrush="{telerik1:Windows8TouchResource ResourceKey=AccentBrush}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerikInput:RadMaskedCurrencyInput" BasedOn="{StaticResource RadMaskedInputBaseStyle}" x:Key="RadMaskedCurrencyInputStyle">
        <Setter Property="InputBehavior" Value="Insert"/>
        <Setter Property="Mask" Value="c9.2"/>
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
        <Setter Property="AllowSkipPlaceholders" Value="false"/>
        <Setter Property="AutoFillZeros" Value="false"/>
        <Setter Property="SectionsNavigationMode" Value="None"/>
    </Style>
    <Style TargetType="telerikInput:RadMaskedNumericInput" BasedOn="{StaticResource RadMaskedInputBaseStyle}" x:Key="RadMaskedNumericInputStyle">
        <Setter Property="InputBehavior" Value="Insert"/>
        <Setter Property="Mask" Value="#9.2"/>
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
        <Setter Property="AllowSkipPlaceholders" Value="false"/>
        <Setter Property="AutoFillZeros" Value="false"/>
        <Setter Property="SectionsNavigationMode" Value="None"/>
    </Style>
    <Style TargetType="telerikInput:RadMaskedTextInput" BasedOn="{StaticResource RadMaskedInputBaseStyle}" x:Key="RadMaskedTextInputStyle">
        <Setter Property="Mask" Value="a20"/>
        <Setter Property="SpinMode" Value="None"/>
        <Setter Property="SelectionOnFocus" Value="CaretToBeginning"/>
        <Setter Property="SectionsNavigationMode" Value="Once"/>
    </Style>
    <Style TargetType="telerikInput:RadMaskedDateTimeInput" BasedOn="{StaticResource RadMaskedInputBaseStyle}" x:Key="RadMaskedDateTimeInputStyle">
        <Setter Property="Mask" Value="d"/>
        <Setter Property="SpinMode" Value="Position"/>
        <Setter Property="SectionsNavigationMode" Value="Once"/>
    </Style>
    <Style TargetType="telerikInput:RadMaskedNumericInput" BasedOn="{StaticResource RadMaskedNumericInputStyle}"/>
    <Style TargetType="telerikInput:RadMaskedCurrencyInput" BasedOn="{StaticResource RadMaskedCurrencyInputStyle}"/>
    <Style TargetType="telerikInput:RadMaskedDateTimeInput" BasedOn="{StaticResource RadMaskedDateTimeInputStyle}"/>
    <Style TargetType="telerikInput:RadMaskedTextInput" BasedOn="{StaticResource RadMaskedTextInputStyle}"/>
    <Style x:Key="CalculatorHistoryDisplay_Style" TargetType="TextBox">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="IsEnabled" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <ScrollViewer x:Name="PART_ContentHost"
                            BorderThickness="0"
                            Background="Transparent"
                            BorderBrush="Transparent"
                            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                            ScrollViewer.VerticalScrollBarVisibility="Disabled"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CalculatorDisplayValue_Style" TargetType="TextBox">
        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <ContentPresenter Content="{TemplateBinding Text}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    </Style>
    <ControlTemplate x:Key="RadCalculatorTemplate" TargetType="telerikInput:RadCalculator">
        <Border x:Name="Calculator" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="MemoryButtonsVisible"/>
                    <VisualState x:Name="MemoryButtonsCollapsed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Mc_Button">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Mr_Button">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Ms_Button">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Mplus_Button">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Mminus_Button">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Height" Storyboard.TargetName="row">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <GridLength>0</GridLength>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="Root">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Border Grid.ColumnSpan="2" Grid.RowSpan="2" Background="{telerik:Windows8TouchResource ResourceKey=AccentBrush}" Margin="-2 -2 -2 0" BorderThickness="1"/>
                    <TextBox x:Name="DisplayTextBox"
                            VerticalAlignment="Bottom"
                            Grid.ColumnSpan="2"
                            Grid.Row="1"
                            FontSize="{telerik:Windows8TouchResource ResourceKey=FontSizeXXL}"
                            HorizontalAlignment="Right"
                            Margin="0 0 7 9"
                            Style="{StaticResource CalculatorDisplayValue_Style}"
                            TextAlignment="Right"
                            Text="{Binding DisplayedValue, RelativeSource={RelativeSource TemplatedParent}}"
                            Foreground="{TemplateBinding Foreground}"/>
                    <TextBlock x:Name="MemoryIndicatorTextBox"
                            FontSize="{telerik:Windows8TouchResource ResourceKey=FontSize}"
                            Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsMemoryUpdated, Converter={StaticResource BooleanToVisibilityConverter}}"
                            Margin="4 6 4 0"
                            Text="M"
                            VerticalAlignment="Top"
                            Foreground="{TemplateBinding Foreground}"/>
                    <TextBox x:Name="HistoryTextBox"
                            TextAlignment="Right"
                            Margin="0 6 2 0"
                            HorizontalAlignment="Right"
                            FontSize="{telerik:Windows8TouchResource ResourceKey=FontSize}"
                            Grid.Column="1"
                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=History, Mode=OneWay}"
                            Style="{StaticResource CalculatorHistoryDisplay_Style}"
                            Foreground="{TemplateBinding Foreground}"
                            VerticalAlignment="Center"/>
                </Grid>
                <Grid Grid.Row="1" Margin="1 0 1 1">
                    <Grid.Resources>
                        <Style TargetType="telerik:RadButton" BasedOn="{StaticResource RadButtonStyle}">
                            <Setter Property="Focusable" Value="False"/>
                            <Setter Property="IsTabStop" Value="False"/>
                            <Setter Property="Margin" Value="1"/>
                            <Setter Property="Padding" Value="7 10"/>
                        </Style>
                    </Grid.Resources>
                    <Grid.RowDefinitions>
                        <RowDefinition x:Name="row"/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <telerik:RadButton x:Name="Mc_Button"
                            Content="MC"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Column="0"
                            BorderBrush="Transparent"
                            Background="Transparent"
                            Command="{x:Static telerikInput:RadCalculatorCommands.MemoryClear}"/>
                    <telerik:RadButton x:Name="Mr_Button"
                            Content="MR"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Column="1"
                            BorderBrush="Transparent"
                            Background="Transparent"
                            Command="{x:Static telerikInput:RadCalculatorCommands.MemoryRecall}"/>
                    <telerik:RadButton x:Name="Ms_Button"
                            Content="MS"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Column="2"
                            BorderBrush="Transparent"
                            Background="Transparent"
                            Command="{x:Static telerikInput:RadCalculatorCommands.MemoryStore}"/>
                    <telerik:RadButton x:Name="Mplus_Button"
                            Content="M+"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Column="3"
                            BorderBrush="Transparent"
                            Background="Transparent"
                            Command="{x:Static telerikInput:RadCalculatorCommands.MemoryPlus}"/>
                    <telerik:RadButton x:Name="Mminus_Button"
                            Content="M-"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Column="4"
                            BorderBrush="Transparent"
                            Background="Transparent"
                            Command="{x:Static telerikInput:RadCalculatorCommands.MemoryMinus}"/>
                    <telerik:RadButton x:Name="Delete_Button"
                            Grid.Row="1"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Column="0"
                            Content="←"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.Delete}"/>
                    <telerik:RadButton x:Name="ClearInput_Button"
                            Grid.Row="1"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Column="1"
                            Content="CE"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.ClearInput}"/>
                    <telerik:RadButton x:Name="ClearEverything_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="1"
                            Grid.Column="2"
                            Content="C"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.ClearEverything}"/>
                    <telerik:RadButton x:Name="Negate_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="1"
                            Grid.Column="3"
                            Content="±"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Operations.Negate}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.ExecuteUnaryOperation}"/>
                    <telerik:RadButton x:Name="SquareRoot_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="1"
                            Grid.Column="4"
                            Content="√"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Operations.SquareRoot}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.ExecuteUnaryOperation}"/>
                    <telerik:RadButton x:Name="input7_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="2"
                            Content="7"
                            FontWeight="Bold"
                            CommandParameter="7"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="input8_Button"
                            Grid.Row="2"
                            Grid.Column="1"
                            Content="8"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="Bold"
                            CommandParameter="8"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="input9_Button"
                            Grid.Row="2"
                            Grid.Column="2"
                            Content="9"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="Bold"
                            CommandParameter="9"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="Divide_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="2"
                            Grid.Column="3"
                            Content="/"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Operations.Divide}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.AddPendingBinaryOperation}"/>
                    <telerik:RadButton x:Name="Percent_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="2"
                            Grid.Column="4"
                            Content="%"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.ExecutePercentOperation}"/>
                    <telerik:RadButton x:Name="input4_Button"
                            Grid.Row="3"
                            Content="4"
                            FontWeight="Bold"
                            FontSize="{TemplateBinding FontSize}"
                            CommandParameter="4"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="input5_Button"
                            Grid.Row="3"
                            Grid.Column="1"
                            Content="5"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="Bold"
                            CommandParameter="5"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="input6_Button"
                            Grid.Row="3"
                            Grid.Column="2"
                            Content="6"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="Bold"
                            CommandParameter="6"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="Multiply_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="3"
                            Grid.Column="3"
                            Content="*"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Operations.Multiply}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.AddPendingBinaryOperation}"/>
                    <telerik:RadButton x:Name="Reciprocal_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="3"
                            Grid.Column="4"
                            Content="1/x"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Operations.Reciprocal}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.ExecuteUnaryOperation}"/>
                    <telerik:RadButton x:Name="input1_Button"
                            Grid.Row="4"
                            Content="1"
                            FontWeight="Bold"
                            FontSize="{TemplateBinding FontSize}"
                            CommandParameter="1"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="input2_Button"
                            Grid.Row="4"
                            Grid.Column="1"
                            Content="2"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="Bold"
                            CommandParameter="2"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="input3_Button"
                            Grid.Row="4"
                            Grid.Column="2"
                            Content="3"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="Bold"
                            CommandParameter="3"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="Substract_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="4"
                            Grid.Column="3"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            Content="-"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Operations.Substract}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.AddPendingBinaryOperation}"/>
                    <telerik:RadButton x:Name="input0_Button"
                            Grid.Row="5"
                            Grid.ColumnSpan="2"
                            FontSize="{TemplateBinding FontSize}"
                            MinWidth="82"
                            Content="0"
                            FontWeight="Bold"
                            CommandParameter="0"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="FloatingPoint_Button"
                            Grid.Row="5"
                            Grid.Column="2"
                            Content="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DecimalSeparator}"
                            FontSize="{TemplateBinding FontSize}"
                            FontWeight="Bold"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DecimalSeparator}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.UpdateInput}"/>
                    <telerik:RadButton x:Name="Add_Button"
                            FontSize="{TemplateBinding FontSize}"
                            Grid.Row="5"
                            Grid.Column="3"
                            Content="+"
                            Foreground="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Operations.Add}"
                            Command="{x:Static telerikInput:RadCalculatorCommands.AddPendingBinaryOperation}"/>
                    <telerik:RadButton x:Name="Equals_Button"
                            Grid.Row="4"
                            Grid.Column="4"
                            Grid.RowSpan="2"
                            FontSize="{TemplateBinding FontSize}"
                            Content="="
                            MinHeight="82"
                            Command="{x:Static telerikInput:RadCalculatorCommands.ExecuteBinaryOperation}"/>
                </Grid>
            </Grid>
        </Border>
    </ControlTemplate>
    <Style x:Key="RadCalculatorStyle" TargetType="telerikInput:RadCalculator">
        <Setter Property="Template" Value="{StaticResource RadCalculatorTemplate}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=InvertedForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="MinWidth" Value="216"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style TargetType="telerikInput:RadCalculator" BasedOn="{StaticResource RadCalculatorStyle}"/>
    <Style x:Key="CalculatorPickerDisplayValue_Style" TargetType="TextBox">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="IsEnabled" Value="False"/>
        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <ScrollViewer x:Name="PART_ContentHost"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            BorderBrush="Transparent"
                            BorderThickness="0"
                            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                            ScrollViewer.VerticalScrollBarVisibility="Disabled"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Margin="1"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="RadCalculatorPickerTemplate" TargetType="telerikInput:RadCalculatorPicker">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="BackgroundVisual"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    Grid.ColumnSpan="2"/>
            <TextBox x:Name="PART_CalculatorInput"
                    Foreground="{TemplateBinding Foreground}"
                    MinHeight="0"
                    Padding="{TemplateBinding Padding}"
                    Style="{StaticResource CalculatorPickerDisplayValue_Style}"
                    Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DisplayedValue, Mode=TwoWay}"/>
            <telerik:RadDropDownButton x:Name="PART_DropDownButton"
                    Width="36"
                    CloseOnEnter="True"
                    Grid.Column="1"
                    DropDownIndicatorVisibility="Collapsed"
                    HorizontalAlignment="Stretch"
                    HorizontalContentAlignment="Stretch"
                    IsTabStop="False"
                    IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                    Padding="0"
                    PopupPlacementTarget="{Binding ElementName=PART_CalculatorInput}"
                    TabIndex="1"
                    VerticalAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    Focusable="False">
                <telerik:RadDropDownButton.DropDownContent>
                    <Grid>
                        <telerikInput:RadCalculator x:Name="PART_Calculator"
                                Margin="0 1 0 0"
                                MemoryButtonsVisibility="{TemplateBinding MemoryButtonsVisibility}"
                                Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=Value}"
                                MemoryValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=MemoryValue}"
                                ErrorMessage="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=ErrorMessage}"/>
                    </Grid>
                </telerik:RadDropDownButton.DropDownContent>
                <telerik:RadDropDownButton.Template>
                    <ControlTemplate TargetType="telerik:RadDropDownButton">
                        <Grid>
                            <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <Popup x:Name="DropDownPopup"
                                    AllowsTransparency="True"
                                    StaysOpen="False"
                                    Focusable="false"
                                    Placement="Bottom"
                                    IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}">
                                <ContentPresenter x:Name="DropDownPopupContent"
                                        Content="{TemplateBinding DropDownContent}"
                                        ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                        DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </telerik:RadDropDownButton.Template>
                <Grid>
                    <telerik:RadToggleButton x:Name="ButtonChrome"
                            IsThreeState="False"
                            Background="Transparent"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            IsChecked="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                            Width="36"/>
                    <Border x:Name="DropDownIcon" Background="{TemplateBinding Background}" Margin="{TemplateBinding BorderThickness}">
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" Width="18" Height="24" SnapsToDevicePixels="True">
                            <Rectangle Fill="White" Stroke="{telerik:Windows8TouchResource ResourceKey=HighBrush}"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=AccentBrush}" Margin="2 2 2 0" VerticalAlignment="Top" Height="5"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 18 12 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 13 12 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 8 12 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 18 7 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 13 7 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 8 7 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 18 2 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 13 2 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                            <Rectangle Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}" Margin="0 8 2 0" Height="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="4"/>
                        </Grid>
                    </Border>
                </Grid>
            </telerik:RadDropDownButton>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadCalculatorPickerStyle" TargetType="telerikInput:RadCalculatorPicker">
        <Setter Property="Template" Value="{StaticResource RadCalculatorPickerTemplate}"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="8"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
    </Style>
    <Style TargetType="telerikInput:RadCalculatorPicker" BasedOn="{StaticResource RadCalculatorPickerStyle}"/>
    <Style x:Key="RadAutoCompleteBoxItemStyle" TargetType="telerikInput:RadAutoCompleteBoxItem">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Margin" Value="3 3 0 0"/>
        <Setter Property="Padding" Value="3 -2 0 0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerikInput:RadAutoCompleteBoxItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="1"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Border" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <ContentPresenter x:Name="ContentPresenter"
                                        Margin="{TemplateBinding Padding}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                <telerik:RadButton x:Name="RemoveItemButton"
                                        Grid.Column="1"
                                        Margin="4 0"
                                        HorizontalAlignment="Right"
                                        VerticalAlignment="Center"
                                        Padding="0"
                                        Width="12"
                                        Height="12"
                                        HorizontalContentAlignment="Center"
                                        CommandParameter="{Binding}"
                                        Cursor="Arrow"
                                        IsTabStop="False"
                                        Command="{x:Static telerik:RadAutoCompleteBoxCommands.RemoveItem}"
                                        Focusable="False">
                                    <Path
                                            Stroke="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                                            Data="M0,0 L5,5 M5,0 L0,5"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Stretch="Uniform"
                                            Width="6"
                                            Height="6"/>
                                </telerik:RadButton>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RadAutoCompleteTextBoxStyle" BasedOn="{StaticResource RadWatermarkTextBoxStyle}" TargetType="telerik:RadWatermarkTextBox">
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Margin" Value="3 3 0 0"/>
        <Setter Property="Padding" Value="0 3"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="FontSize" Value="{Binding FontSize, RelativeSource={RelativeSource AncestorType=telerikInput:RadAutoCompleteBox}}"/>
        <Setter Property="FontFamily" Value="{Binding FontFamily, RelativeSource={RelativeSource AncestorType=telerikInput:RadAutoCompleteBox}}"/>
    </Style>
    <ControlTemplate x:Key="RadAutoCompleteBoxTemplate" TargetType="telerikInput:RadAutoCompleteBox">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="0.5"/>
                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Border"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused"/>
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
            <Border x:Name="MouseOverVisual"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    Opacity="0"/>
            <Border x:Name="FocusVisual"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    Opacity="0"/>
            <Border x:Name="DisabledVisualElement"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    IsHitTestVisible="False"
                    Opacity="0"/>
            <ScrollViewer x:Name="PART_ScrollViewer"
                    Height="{TemplateBinding Height}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    BorderThickness="0"
                    Background="Transparent"
                    Padding="1"
                    IsTabStop="False"
                    HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                    VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                    Margin="{TemplateBinding BorderThickness}"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                <telerikInput:AutoCompleteBoxesItemsControl x:Name="PART_Boxes"
                        DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
                        BoxesItemTemplate="{TemplateBinding BoxesItemTemplate}"
                        BoxesItemTemplateSelector="{TemplateBinding BoxesItemTemplateSelector}"
                        BoxesItemStyle="{TemplateBinding BoxesItemStyle}"
                        BoxesItemStyleSelector="{TemplateBinding BoxesItemStyleSelector}"
                        IsTabStop="False"
                        Foreground="{TemplateBinding Foreground}"
                        Margin="{TemplateBinding Padding}">
                    <telerikInput:AutoCompleteBoxesItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <telerikInput:AutoCompleteBoxesWrapPanel Width="{Binding ActualWidth, ElementName=WatermarkTextBox}"/>
                        </ItemsPanelTemplate>
                    </telerikInput:AutoCompleteBoxesItemsControl.ItemsPanel>
                </telerikInput:AutoCompleteBoxesItemsControl>
            </ScrollViewer>
            <Popup x:Name="PART_Popup">
                <Grid x:Name="PopupRoot" MinWidth="{TemplateBinding MinDropDownWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
                    <telerik:RadListBox x:Name="PART_ListBox"
                            ItemsSource="{TemplateBinding FilteredItems}"
                            ItemTemplate="{TemplateBinding DropDownItemTemplate}"
                            Margin="0 1 0 0"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    <Border
                            Background="{Binding Background, ElementName=PART_ListBox}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="1"
                            Width="{Binding ElementName=PART_ListBox, Path=Width}"
                            Visibility="{Binding ElementName=PART_NoResultsContentPresenter, Path=Visibility}"
                            Margin="0 1 0 0"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <ContentPresenter x:Name="PART_NoResultsContentPresenter"
                                MinWidth="{TemplateBinding MinDropDownWidth}"
                                MaxHeight="{TemplateBinding MaxDropDownHeight}"
                                Content="{TemplateBinding NoResultsContent}"
                                ContentTemplate="{TemplateBinding NoResultsContentTemplate}"
                                Margin="3 7"
                                Visibility="Collapsed">
                            <ContentPresenter.Resources>
                                <Style TargetType="TextBlock">
                                    <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
                                </Style>
                            </ContentPresenter.Resources>
                        </ContentPresenter>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadAutoCompleteBoxStyle" TargetType="telerikInput:RadAutoCompleteBox">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="TextBoxStyle" Value="{StaticResource RadAutoCompleteTextBoxStyle}"/>
        <Setter Property="Template" Value="{StaticResource RadAutoCompleteBoxTemplate}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="Padding" Value="0 0 3 3"/>
        <Setter Property="Cursor" Value="IBeam"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
    </Style>
    <Style TargetType="telerikInput:RadAutoCompleteBoxItem" BasedOn="{StaticResource RadAutoCompleteBoxItemStyle}"/>
    <Style TargetType="telerikInput:RadAutoCompleteBox" BasedOn="{StaticResource RadAutoCompleteBoxStyle}"/>
    <Style x:Key="TimeSpanPickerWatermarkTextBoxStyle" TargetType="telerik:RadWatermarkTextBox">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadWatermarkTextBox">
                    <Grid x:Name="RootElement">
                        <ScrollViewer x:Name="PART_ContentHost"
                                Background="Transparent"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                BorderThickness="0"
                                IsTabStop="False"
                                Padding="{TemplateBinding Padding}"/>
                        <ContentControl x:Name="WatermarkVisualElement"
                                IsTabStop="False"
                                FontStyle="Italic"
                                Content="{TemplateBinding WatermarkContent}"
                                ContentTemplate="{TemplateBinding WatermarkTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                IsHitTestVisible="False"
                                Visibility="Hidden"
                                Padding="{TemplateBinding Padding}"
                                Margin="2 0 0 0"
                                Opacity="0.5"
                                Foreground="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}">
                            <ContentControl.Template>
                                <ControlTemplate TargetType="ContentControl">
                                    <ContentPresenter Margin="{TemplateBinding Padding}"/>
                                </ControlTemplate>
                            </ContentControl.Template>
                        </ContentControl>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="PART_ContentHost" Property="Opacity" Value="0.5"/>
                        </Trigger>
                        <Trigger Property="IsWatermarkVisible" Value="True">
                            <Setter TargetName="WatermarkVisualElement" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="RadTimeSpanPickerComponentTemplate" TargetType="telerikInput:RadTimeSpanPickerComponent">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    Foreground="{TemplateBinding Foreground}"
                    FontWeight="{TemplateBinding FontWeight}"
                    FontSize="{TemplateBinding FontSize}"
                    FontFamily="{TemplateBinding FontFamily}"
                    Visibility="{Binding Header, Converter={StaticResource NullToVisibilityConverterInstance}}"
                    Text="{Binding Header}"
                    Margin="0 0 0 11"/>
            <telerik:RadListBox Grid.Row="1" ItemsSource="{Binding ItemsSource}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" MinWidth="121">
                <telerik:RadListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel/>
                    </ItemsPanelTemplate>
                </telerik:RadListBox.ItemsPanel>
            </telerik:RadListBox>
        </Grid>
    </ControlTemplate>
    <Style x:Key="RadTimeSpanPickerComponentStyle" TargetType="telerikInput:RadTimeSpanPickerComponent">
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Margin" Value="5 12 5 11"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Template" Value="{StaticResource RadTimeSpanPickerComponentTemplate}"/>
    </Style>
    <ControlTemplate x:Key="RadTimeSpanPickerTemplate" TargetType="telerikInput:RadTimeSpanPicker">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="BorderVisual"
                    Grid.ColumnSpan="2"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
            <telerik:RadWatermarkTextBox x:Name="PART_TimeSpanInput"
                    Text="{TemplateBinding TimeSpanText}"
                    WatermarkContent="{TemplateBinding TimeSpanWatermarkContent}"
                    WatermarkTemplate="{TemplateBinding TimeSpanWatermarkTemplate}"
                    TextAlignment="{TemplateBinding TextAlignment}"
                    TabIndex="0"
                    VerticalAlignment="Stretch"
                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    Background="{x:Null}"
                    BorderThickness="0"
                    BorderBrush="{x:Null}"
                    FontSize="{TemplateBinding FontSize}"
                    Padding="{TemplateBinding Padding}"
                    Style="{StaticResource TimeSpanPickerWatermarkTextBoxStyle}"
                    MinHeight="0"/>
            <Border x:Name="FocusVisual"
                    Opacity="0"
                    IsHitTestVisible="False"
                    MinHeight="{TemplateBinding MinHeight}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                    Background="{x:Null}"
                    BorderBrush="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"
                    Grid.Column="1"/>
            <telerik:RadDropDownButton
                    Grid.Column="1"
                    TabIndex="1"
                    FocusVisualStyle="{x:Null}"
                    x:Name="PART_DropDownButton"
                    PopupPlacementTarget="{Binding ElementName=PART_TimeSpanInput}"
                    IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                    CloseOnEnter="False"
                    IsTabStop="False"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Stretch"
                    Focusable="False"
                    Padding="2 0">
                <telerik:RadDropDownButton.DropDownContent>
                    <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" Width="{TemplateBinding DropDownWidth}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border
                                Grid.RowSpan="2"
                                IsHitTestVisible="False"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"/>
                        <ItemsControl
                                ItemContainerStyle="{TemplateBinding TimeSpanComponentStyle}"
                                ItemContainerStyleSelector="{TemplateBinding TimeSpanComponentStyleSelector}"
                                Focusable="False"
                                Background="Transparent"
                                Padding="7 0 7 2">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <DockPanel/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                        </ItemsControl>
                        <Border x:Name="ButtonsContainer"
                                Grid.Row="1"
                                BorderThickness="1"
                                Background="{telerik:Windows8TouchResource ResourceKey=LowBrush}"
                                BorderBrush="{telerik:Windows8TouchResource ResourceKey=MediumBrush}">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                <telerik:RadButton x:Name="PART_Clear"
                                        FocusVisualStyle="{x:Null}"
                                        HorizontalAlignment="Right"
                                        telerik:LocalizationManager.ResourceKey="Clear"
                                        Command="{x:Static telerikInput:TimeSpanPickerCommands.Clear}"
                                        KeyboardNavigation.TabNavigation="Once"
                                        Margin="11 6 11 5"
                                        Padding="15 8"/>
                                <telerik:RadButton x:Name="PART_Close"
                                        HorizontalAlignment="Right"
                                        Command="{x:Static telerikInput:TimeSpanPickerCommands.Close}"
                                        telerik:LocalizationManager.ResourceKey="Close"
                                        FocusVisualStyle="{x:Null}"
                                        KeyboardNavigation.TabNavigation="Once"
                                        Margin="0 6 11 5"
                                        Padding="15 8"/>
                            </StackPanel>
                        </Border>
                    </Grid>
                </telerik:RadDropDownButton.DropDownContent>
                <telerik:RadDropDownButton.Template>
                    <ControlTemplate TargetType="telerik:RadDropDownButton">
                        <Grid>
                            <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <Popup x:Name="DropDownPopup"
                                    AllowsTransparency="True"
                                    StaysOpen="False"
                                    Focusable="false"
                                    Placement="Bottom"
                                    IsOpen="{Binding Path=IsOpen, RelativeSource={RelativeSource TemplatedParent}}"
                                    VerticalOffset="-1">
                                <ContentPresenter x:Name="DropDownPopupContent"
                                        Content="{TemplateBinding DropDownContent}"
                                        ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                        DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </telerik:RadDropDownButton.Template>
                <Grid x:Name="DropDownIcon" Margin="0 1" Background="Transparent">
                    <Border x:Name="TimeSpanPicker" Margin="10 0">
                        <Path x:Name="TimeSpanPickerIcon"
                                SnapsToDevicePixels="True"
                                Fill="{telerik:Windows8TouchResource ResourceKey=HighBrush}"
                                Data="M9.3,4.4 L9.3,10.6 L15.4,10.6 L15.4,10.6 C15.2,7.4 12.7,4.9 9.5,4.4 z M7.6,4.4 L7.6,4.4 C4.1,4.8 1.5,7.6 1.5,10.9 C1.5,14.5 4.6,17.5 8.5,17.5 C11.9,17.5 14.7,15.2 15.3,12.1 L15.3,12 L7.6,12 L7.6,10.6 z M6.9,0 L7.7,0 L9.2,0 L10.0,0 L10.0,1.4 L9.2,1.4 L9.2,2.9 L9.3,2.9 C13.6,3.3 17,6.7 17,10.9 C17,15.4 13.1,19 8.5,19 C3.8,19 0,15.4 0,10.9 C0,6.7 3.3,3.3 7.6,2.9 L7.7,2.9 L7.7,1.4 L6.9,1.4 z"
                                Width="16"
                                Height="18"
                                Stretch="Fill"/>
                    </Border>
                </Grid>
            </telerik:RadDropDownButton>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=HighBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
                <Setter TargetName="DropDownIcon" Property="Opacity" Value="0.5"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
                <Setter TargetName="FocusVisual" Property="Opacity" Value="1"/>
                <Setter TargetName="BorderVisual" Property="Opacity" Value="1"/>
                <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=AccentBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="RadTimeSpanPickerStyle" TargetType="telerikInput:RadTimeSpanPicker">
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="Background" Value="{telerik:Windows8TouchResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:Windows8TouchResource ResourceKey=MediumBrush}"/>
        <Setter Property="Foreground" Value="{telerik:Windows8TouchResource ResourceKey=MainForegroundBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:Windows8TouchResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:Windows8TouchResource ResourceKey=FontSizeL}"/>
        <Setter Property="Padding" Value="10 0"/>
        <Setter Property="MaxDropDownHeight" Value="320"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="KeyboardNavigation.ControlTabNavigation" Value="Cycle"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
        <Setter Property="Template" Value="{StaticResource RadTimeSpanPickerTemplate}"/>
    </Style>
    <Style TargetType="telerikInput:RadTimeSpanPicker" BasedOn="{StaticResource RadTimeSpanPickerStyle}"/>
    <Style TargetType="telerikInput:RadTimeSpanPickerComponent" BasedOn="{StaticResource RadTimeSpanPickerComponentStyle}"/>
</ResourceDictionary>
