<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Telerik.UI.Xaml.Controls.Grid"
    xmlns:localPrimitives="using:Telerik.UI.Xaml.Controls.Grid.Primitives"
    xmlns:localView="using:Telerik.UI.Xaml.Controls.Grid.View"
    xmlns:primitives="using:Telerik.UI.Xaml.Controls.Primitives"
    xmlns:localTheming="using:Telerik.UI.Xaml.Controls.Grid.Theming">

    <localTheming:PaletteInitializer x:Key="PaletteInitializer"/>

    <Style TargetType="localPrimitives:RotatedContainer">
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:RotatedContainer">
                    <ContentPresenter Content="{TemplateBinding Child}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:RadDataGrid">
        <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
        <Setter Property="Foreground" Value="{StaticResource TelerikGridForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource TelerikGridBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TelerikGridBorderBrush}"/>
        <Setter Property="BorderThickness" Value="2,0,2,2"/>
        <Setter Property="GridLinesBrush" Value="{StaticResource TelerikGridBorderBrush}"/>
        <Setter Property="AlternateRowBackground" Value="{StaticResource TelerikGridAlternateRowBackgroundBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="MinWidth" Value="100"/>
        <Setter Property="MinHeight" Value="100"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RadDataGrid">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <localPrimitives:DataGridRootPanel x:Name="PART_TableRoot">

                            <localPrimitives:DataGridColumnHeaderPanel x:Name="PART_ColumnsHost"/>
                            <ScrollViewer x:Name="PART_ScrollViewer" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
                                          HorizontalScrollMode="Auto" VerticalScrollMode="Auto" ZoomMode="Disabled">
                                <Grid>
                                    <Canvas x:Name="PART_DecorationsHost"/>
                                    <localPrimitives:DataGridCellsPanel x:Name="PART_CellsHost" Background="#00000000"/>
                                </Grid>
                            </ScrollViewer>

                            <localPrimitives:FrozenGroupsPanel x:Name="PART_HeadersHost" />
                            <localPrimitives:DataGridServicePanel x:Name="PART_ServicePanel"/>
                            <Canvas x:Name="PART_AdornerHost" IsHitTestVisible="False"/>
                        </localPrimitives:DataGridRootPanel>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="localPrimitives:DataGridServicePanel">
        <Setter Property="Background" Value="{StaticResource TelerikGridServiceColumnBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource TelerikGridServiceColumnForegroundBrush}"/>
        <Setter Property="Padding" Value="6"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Margin" Value="-2,0,-2,-2"/>
        <Setter Property="Width" Value="40"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:DataGridServicePanel">
                    <Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="NormalGrouped">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphRotateTransform" Storyboard.TargetProperty="Angle">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="-45"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHintGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHereText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphRotateTransform" Storyboard.TargetProperty="Angle">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="135"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHintGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHereText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridFlyoutBorderBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Fill" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnFlyoutBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DragHinting">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Fill" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnActiveBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHintGlyph" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnActiveForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHereText" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnActiveForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHintGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHereText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropPossible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Fill" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnActiveBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHintGlyph" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnActiveForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHereText" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnActiveForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHintGlyph" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DragHereText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="2"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource TelerikGridServiceColumnActiveForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="2"/>
                            </Grid.ColumnDefinitions>
                            <Grid Background="{TemplateBinding Background}" x:Name="Fill">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="1"/>
                                </Grid.ColumnDefinitions>
                                <Grid Margin="{TemplateBinding Padding}">
                                    <StackPanel Orientation="Horizontal" x:Name="ExpandCollapseGlyph" RenderTransformOrigin="0.5,0.5" 
                                                HorizontalAlignment="Center" VerticalAlignment="Top" Visibility="Collapsed">
                                        <StackPanel.RenderTransform>
                                            <RotateTransform Angle="-45" x:Name="GlyphRotateTransform"/>
                                        </StackPanel.RenderTransform>
                                        <TextBlock FontFamily="{StaticResource SymbolThemeFontFamily}" Text="&#xe111;" FontSize="13" VerticalAlignment="Center"/>
                                        <TextBlock FontFamily="{StaticResource SymbolThemeFontFamily}" Text="&#xe09f;" FontSize="17" Margin="-5,0,0,4" VerticalAlignment="Center"/>
                                    </StackPanel>
                                    <TextBlock x:Name="DragHintGlyph" FontFamily="{StaticResource SymbolThemeFontFamily}" Text="&#xE169;"
                                            HorizontalAlignment="Center" VerticalAlignment="Top" Visibility="Collapsed"/>
                                    <localPrimitives:RotatedContainer RotationAngle="-90" HorizontalAlignment="Center">
                                        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="DragHereText"/>
                                    </localPrimitives:RotatedContainer>
                                </Grid>
                                <Rectangle x:Name="InnerShadow" Fill="{StaticResource TelerikGridInnerShadowBrush}" 
                                       HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1"/>
                            </Grid>
                            <Rectangle x:Name="OuterShadow" Fill="{StaticResource TelerikGridShadowBrush}" 
                                       HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1"/>
                            <Border x:Name="Border" BorderThickness="2,2,0,2" Visibility="Collapsed" Grid.ColumnSpan="2"/>
                            <Popup x:Name="PART_GroupFlyout" IsLightDismissEnabled="True">
                                <Popup.ChildTransitions>
                                    <TransitionCollection>
                                        <PaneThemeTransition Edge="Left"/>
                                    </TransitionCollection>
                                </Popup.ChildTransitions>
                                <localPrimitives:DataGridServicePanelGroupingFlyout x:Name="PART_GroupFlyoutContent" Margin="-2,0,0,0"/>
                            </Popup>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="localPrimitives:DataGridServicePanelGroupingFlyout">
        <Setter Property="Background" Value="{StaticResource TelerikGridFlyoutBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TelerikGridFlyoutBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0,2,2,2"/>
        <Setter Property="Padding" Value="16"/>
        <Setter Property="MinWidth" Value="210"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:DataGridServicePanelGroupingFlyout">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="2"/>
                        </Grid.ColumnDefinitions>
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <localPrimitives:DataGridGroupingFlyoutPanel Margin="{TemplateBinding Padding}" x:Name="PART_GroupHeaderContainer"/>
                        </Border>
                        <Canvas x:Name="PART_AdornerHost" IsHitTestVisible="False"/>
                        <Rectangle Fill="{StaticResource TelerikGridShadowBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <localView:SortOrderToGlyphConverter x:Key="SortOrderConverter"/>
    
    <Style TargetType="localPrimitives:DataGridFlyoutGroupHeader">
        <Setter Property="Background" Value="{StaticResource TelerikGridFlyoutGroupHeaderBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource TelerikGridFlyoutGroupHeaderForegroundBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="MinWidth" Value="126"/>
        <Setter Property="MinHeight" Value="40"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:DataGridFlyoutGroupHeader">
                    <Grid HorizontalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Padding}" x:Name="PART_DescriptorContent">
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,0,0">
                                <TextBlock FontFamily="Segoe UI Bold" Text="&#x2261;" VerticalAlignment="Center"/>
                                <ContentControl Margin="10,0,0,0" VerticalAlignment="Center" Content="{Binding DisplayContent}"/>
                                <TextBlock Text="{Binding SortOrder, Converter={StaticResource SortOrderConverter}}" 
                                            FontFamily="{StaticResource SymbolThemeFontFamily}" FontSize="10" Margin="6,0,4,2" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Border>
                        <localPrimitives:DataGridServiceButton x:Name="PART_CloseButton" Content="&#xe10a;" Width="40" Height="40" Margin="2,0,0,0" Grid.Column="1"/>
                        <TextBlock Grid.Row="1" Grid.ColumnSpan="2" FontFamily="{StaticResource SymbolThemeFontFamily}" FontSize="9" Text="&#x25bc;"
                                   Opacity="{TemplateBinding BottomGlyphOpacity}" Margin="11,2,0,2"
                                   Foreground="{StaticResource TelerikGridFlyoutGroupForegroundBrush}"/>
                        <Rectangle Margin="-2" StrokeThickness="2" Stroke="{TemplateBinding Foreground}" Grid.ColumnSpan="2"
                                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{TemplateBinding OuterBorderVisibility}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="ExpandIconStroke" Color="Black" />
    <LinearGradientBrush x:Key="ExpandIconBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFFFFFFF" Offset="0"/>
        <GradientStop Color="#FFD0D0D0" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ExpandIconBorder" EndPoint="1,1" StartPoint="0,0">
        <GradientStop Color="#FFBEBEBE" Offset="0"/>
        <GradientStop Color="#FF282828" Offset="1"/>
        <GradientStop Color="#FF737373" Offset="0.5"/>
    </LinearGradientBrush>

    <Style TargetType="localPrimitives:DataGridGroupHeader">
        <Setter Property="Background" Value="{StaticResource TelerikGridGroupHeaderBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TelerikGridGroupHeaderForegroundBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="MinHeight" Value="40" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding Group.Key}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:DataGridGroupHeader">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ExpandStates">
                                <VisualState x:Name="Expanded" />
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CollapseIcon" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandIcon" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <!--A placeholder for the IndentWidth property-->
                            <Rectangle Width="{TemplateBinding IndentWidth}"/>
                            <Grid Grid.Column="1" 
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <Grid Margin="4,0,4,0" HorizontalAlignment="Left" VerticalAlignment="Center">
                                    <TextBlock FontFamily="{StaticResource SymbolThemeFontFamily}" 
                                           Foreground="{StaticResource TelerikGridGroupHeaderArrowForegroundBrush}"
                                           Text="&#xE0A0;" x:Name="CollapseIcon" Margin="6,0,0,6"/>
                                    <TextBlock FontFamily="{StaticResource SymbolThemeFontFamily}" 
                                           Foreground="{StaticResource TelerikGridGroupHeaderArrowForegroundBrush}"
                                           Text="&#xE0A1;" x:Name="ExpandIcon"  Margin="6,0,0,6" Opacity="0"/>
                                </Grid>
                                <ContentPresenter x:Name="testControl" Grid.Column="1" Margin="6,0,0,3" Content="{TemplateBinding DataContext}"  ContentTemplate="{TemplateBinding ContentTemplate}"
                                              HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                            </Grid>
                        </Grid>
                        <Rectangle Height="1" Fill="{StaticResource TelerikGridInnerShadowBrush}" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Margin="0,0,0,2"/>
                        <Rectangle Height="2" Fill="{StaticResource TelerikGridShadowBrush}" VerticalAlignment="Bottom" Grid.ColumnSpan="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

    <localView:SortDirectionToGlyphConverter x:Key="SortDirectionConverter"/>

    <Style TargetType="localPrimitives:DataGridColumnHeader">
        <Setter Property="Foreground" Value="{StaticResource TelerikGridHeaderForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource TelerikGridHeaderBackgroundBrush}"/>
        <Setter Property="MinWidth" Value="6"/>
        <Setter Property="MinHeight" Value="6"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:DataGridColumnHeader">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                            <ContentPresenter Content="{TemplateBinding Content}" Margin="8"/>
                            <TextBlock Text="{Binding SortDirection, Converter={StaticResource SortDirectionConverter}}" FontFamily="{StaticResource SymbolThemeFontFamily}" FontSize="10"  Margin="2,0,4,2" VerticalAlignment="Center"/>
                        </StackPanel>
                        <Rectangle Fill="{StaticResource TelerikGridInnerShadowBrush}" Height="1" VerticalAlignment="Bottom" Margin="0,1,0,3"/>
                        <Rectangle Fill="{StaticResource TelerikGridShadowBrush}" Height="3" VerticalAlignment="Bottom" Margin="0,3,0,0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="localPrimitives:DataGridColumnDragControl">
        <Setter Property="Foreground" Value="{StaticResource TelerikGridServiceColumnActiveForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource TelerikGridServiceColumnActiveBackgroundBrush}"/>
        <Setter Property="MinWidth" Value="6"/>
        <Setter Property="MinHeight" Value="6"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:DataGridColumnDragControl">
                    <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                            <TextBlock Text="&#x2261;" FontSize="16" FontFamily="{StaticResource SymbolThemeFontFamily}" VerticalAlignment="Center"  Margin="4"/>
                            <ContentPresenter Content="{TemplateBinding Content}" Margin="2 8 8 8"/>
                        </StackPanel>
                        <Rectangle Fill="{StaticResource TelerikGridInnerShadowBrush}" Height="1" VerticalAlignment="Bottom" Margin="0,1,0,3"/>
                        <Rectangle Fill="{StaticResource TelerikGridShadowBrush}" Height="3" VerticalAlignment="Bottom" Margin="0,3,0,0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="localPrimitives:SelectionRegionControl">
        <Setter Property="BorderBrush" Value="{StaticResource TelerikGridSelectedBorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource TelerikGridSelectedBackgroundBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:SelectionRegionControl">
                    <Grid>
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <Rectangle Stroke="{StaticResource TelerikGridBackgroundBrush}" StrokeThickness="1"/>
                        </Border>
                        <!--TODO: This is the top-left gripper (selection handler) UI-->
                        <!--<Border Width="16" Height="16" BorderBrush="#2D2D2D"  BorderThickness="2 2 0 0" VerticalAlignment="Top" HorizontalAlignment="Left" />
                        <Border x:Name="TopLeft_Thumb"  Width="14" Height="14"  BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="4 4 0 0" VerticalAlignment="Top" HorizontalAlignment="Left"/>-->

                        <!--TODO: This is the bottom-right gripper (selection handler) UI-->
                        <!--<Border Width="16" Height="16" BorderBrush="#2D2D2D"  BorderThickness="0 0 2 2" VerticalAlignment="Bottom" HorizontalAlignment="Right" />-->
                        <!--<Border x:Name="BottomRight_Thumb"  Width="14" Height="14"  BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 0 4 4" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>-->
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="localPrimitives:DataGridHoverControl">
        <Setter Property="Background" Value="{StaticResource TelerikGridPointerOverBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localPrimitives:DataGridHoverControl">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="localPrimitives:DataGridServiceButton">
        <Setter Property="Background" Value="{StaticResource TelerikGridServiceButtonBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TelerikGridServiceButtonForegroundBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikGridServiceButtonPointerOverBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikGridServiceButtonPressedBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TelerikGridServiceButtonPressedForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <TextBlock x:Name="ContentPresenter" FontFamily="{StaticResource SymbolThemeFontFamily}" Text="{TemplateBinding Content}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
