<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:dataPager="clr-namespace:Telerik.Windows.Controls.Data.DataPager;assembly=Telerik.Windows.Controls.Data"
        xmlns:c="http://schemas.telerik.com/2008/xaml/compile"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="c"
        xmlns:mat="clr-namespace:Telerik.Windows.Controls.MaterialControls;assembly=Telerik.Windows.Controls"
        xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
        xmlns:dataFilter="clr-namespace:Telerik.Windows.Controls.Data.DataFilter;assembly=Telerik.Windows.Controls.Data"
        xmlns:dataForm="clr-namespace:Telerik.Windows.Controls.Data.DataForm;assembly=Telerik.Windows.Controls.Data"
        xmlns:collectionNavigator="clr-namespace:Telerik.Windows.Controls.Data.CollectionNavigator;assembly=Telerik.Windows.Controls.Data"
        xmlns:propertyGrid="clr-namespace:Telerik.Windows.Controls.Data.PropertyGrid;assembly=Telerik.Windows.Controls.Data"
        xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
        xmlns:grid="clr-namespace:Telerik.Windows.Controls.Data.CardView;assembly=Telerik.Windows.Controls.Data"
        xmlns:input="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
        xmlns:ext="clr-namespace:Telerik.Windows.Controls.MarkupExtensions;assembly=Telerik.Windows.Controls"
        xmlns:layouts="clr-namespace:Telerik.Windows.Controls.Layouts;assembly=Telerik.Windows.Controls">
    <ResourceDictionary.MergedDictionaries>
        <telerik:FluentResourceDictionary/>
    </ResourceDictionary.MergedDictionaries>
    <telerik1:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <telerik1:ThicknessToOrientedThicknessConverter x:Key="ThicknessToOrientedThicknessConverter"/>
    <telerik1:OpacityConverter x:Key="OpacityConverter"/>
    <telerik1:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
    <telerik1:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
    <Geometry x:Key="ArrowTopRight8x8">M0,0 L8,0 8,8 z</Geometry>
    <sys:String x:Key="GlyphArrow60Up"></sys:String>
    <sys:String x:Key="GlyphArrow60Right"></sys:String>
    <sys:String x:Key="GlyphArrow60Down"></sys:String>
    <sys:String x:Key="GlyphArrow60Left"></sys:String>
    <sys:String x:Key="GlyphArrowForward"></sys:String>
    <sys:String x:Key="GlyphArrowBackward"></sys:String>
    <sys:String x:Key="GlyphArrowChevronUp"></sys:String>
    <sys:String x:Key="GlyphArrowChevronRight"></sys:String>
    <sys:String x:Key="GlyphArrowChevronDown"></sys:String>
    <sys:String x:Key="GlyphCategorize"></sys:String>
    <sys:String x:Key="GlyphGridLayout"></sys:String>
    <sys:String x:Key="GlyphEdit"></sys:String>
    <sys:String x:Key="GlyphDelete"></sys:String>
    <sys:String x:Key="GlyphClose"></sys:String>
    <sys:String x:Key="GlyphPlus"></sys:String>
    <sys:String x:Key="GlyphMinus"></sys:String>
    <sys:String x:Key="GlyphSortAscSmall"></sys:String>
    <sys:String x:Key="GlyphSortDescSmall"></sys:String>
    <sys:String x:Key="GlyphFilter"></sys:String>
    <sys:String x:Key="GlyphZoom"></sys:String>
    <sys:String x:Key="GlyphQuestion"></sys:String>
    <sys:String x:Key="GlyphFile"></sys:String>
    <telerik1:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
    <ext:DynamicResourceProxy x:Key="PrimaryBackgroundBrushProxy" ProxyValue="{Binding Source={x:Static telerik1:FluentPalette.Palette}, Path=PrimaryBackgroundColor, Converter={StaticResource ColorToBrushConverter}}"/>
    <ControlTemplate x:Key="ErrorTooltipTemplate" TargetType="ToolTip">
        <Grid x:Name="RootVisual" HorizontalAlignment="Right" RenderTransformOrigin="0 0" Opacity="0" SnapsToDevicePixels="True">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="OpenStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0"/>
                        <VisualTransition To="Open" GeneratedDuration="0:0:0.3">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="xform" Storyboard.TargetProperty="X" To="0" Duration="0:0:0.3">
                                    <DoubleAnimation.EasingFunction>
                                        <BackEase Amplitude=".4" EasingMode="EaseOut"/>
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                                <DoubleAnimation Storyboard.TargetName="RootVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.3"/>
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="RootVisual" Storyboard.TargetProperty="Opacity" To="0" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Open">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="xform" Storyboard.TargetProperty="X" To="0" Duration="0"/>
                            <DoubleAnimation Storyboard.TargetName="RootVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.RenderTransform>
                <TranslateTransform x:Name="xform" X="-25"/>
            </Grid.RenderTransform>
            <Border Background="{telerik1:FluentResource ResourceKey=ValidationBrush}" Margin="1 0 0 0" UseLayoutRounding="True">
                <ContentPresenter
                        Content="{Binding ErrorContent}"
                        Margin="10 6"
                        TextBlock.Foreground="{telerik1:FluentResource ResourceKey=MarkerInvertedBrush}"
                        TextBlock.FontSize="{telerik1:FluentResource ResourceKey=FontSize}"
                        VerticalAlignment="Center"/>
            </Border>
            <ContentControl/>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="StaticValidationTooltipTemplate">
        <StackPanel Orientation="Horizontal">
            <Grid SnapsToDevicePixels="True" VerticalAlignment="Top">
                <AdornedElementPlaceholder x:Name="Holder"/>
                <Border BorderBrush="{telerik1:FluentResource ResourceKey=ValidationBrush}" BorderThickness="1" CornerRadius="{telerik1:FluentResource ResourceKey=CornerRadius}"/>
            </Grid>
            <Grid>
                <Border Background="{telerik1:FluentResource ResourceKey=ValidationBrush}" Margin="1 0 0 0" SnapsToDevicePixels="True">
                    <TextBlock x:Name="PART_ToolTip"
                            FontSize="{telerik1:FluentResource ResourceKey=FontSize}"
                            FontFamily="{telerik:FluentResource ResourceKey=FontFamily}"
                            Foreground="{telerik1:FluentResource ResourceKey=MarkerInvertedBrush}"
                            Padding="10 6"
                            Text="{Binding ElementName=Holder, Path=AdornedElement.(Validation.Errors).CurrentItem.ErrorContent}"/>
                </Border>
            </Grid>
        </StackPanel>
    </ControlTemplate>
    <ControlTemplate x:Key="ValidationTooltipTemplate">
        <Grid SnapsToDevicePixels="True" VerticalAlignment="Top">
            <AdornedElementPlaceholder x:Name="Holder"/>
            <Border BorderBrush="{telerik1:FluentResource ResourceKey=ValidationBrush}" BorderThickness="1" CornerRadius="{telerik1:FluentResource ResourceKey=CornerRadius}"/>
            <Path
                    Data="{StaticResource ArrowTopRight8x8}"
                    Fill="{telerik1:FluentResource ResourceKey=ValidationBrush}"
                    Width="8"
                    Height="8"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Top"
                    Margin="0 1 1 0"/>
            <ToolTipService.ToolTip>
                <ToolTip x:Name="PART_ToolTip"
                        DataContext="{Binding RelativeSource={RelativeSource Mode=Self}, Path=PlacementTarget.DataContext}"
                        Template="{StaticResource ErrorTooltipTemplate}"
                        Placement="Right"/>
            </ToolTipService.ToolTip>
        </Grid>
    </ControlTemplate>
    <dataFilter:LogicalOperatorToCheckedConverter x:Key="LogicalOperatorToCheckedConverter"/>
    <dataFilter:FilterMemberToEnabledConverter x:Key="FilterMemberToEnabledConverter"/>
    <dataFilter:FilterOperatorToSelectedItemConverter x:Key="FilterOperatorToSelectedItemConverter"/>
    <collectionNavigator:CommandsButtonsVisibilityConverter x:Key="VisibilityConverter"/>
    <telerikData:FilterCompositionLogicalOperatorConverter x:Key="LogicalOperatorConverter"/>
    <telerikData:FilterOperatorConverter x:Key="FilterOperatorConverter"/>
    <dataForm:DescriptionVisibilityConverter x:Key="DescriptionVisibilityConverter"/>
    <propertyGrid:FlatItemSourceConverter x:Key="FlatItemSourceConverter"/>
    <propertyGrid:HeaderVisibilityConverter x:Key="HeaderVisibilityConverter"/>
    <grid:SortingIndexConverter x:Key="SortingIndexConverter"/>
    <grid:SortingIndexToVisibilityConverter x:Key="SortingIndexToVisibilityConverter"/>
    <grid:CardViewFilterOperatorConverter x:Key="CardViewFilterOperatorConverter"/>
    <grid:FilterOperatorToFilterEditorIsEnabledConverter x:Key="FilterOperatorToFilterEditorIsEnabledConverter"/>
    <grid:DistinctValueConverter x:Key="DistinctValueConverter"/>
    <telerikData:FilterCompositionLogicalOperatorConverter x:Key="FilterCompositionLogicalOperatorConverter"/>
    <grid:CardDataFieldDescriptorHeaderConverter x:Key="CardDataFieldDescriptorHeaderConverter"/>
    <Style x:Key="TextBoxStyle" TargetType="TextBox">
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik1:FluentResource ResourceKey=PrimaryMouseOverBrush}"/>
        <Setter Property="mat:MaterialAssist.FocusBrush" Value="{telerik1:FluentResource ResourceKey=AccentFocusedBrush}"/>
        <Setter Property="mat:MaterialAssist.CornerRadius" Value="{telerik1:FluentResource ResourceKey=CornerRadius}"/>
        <Setter Property="SelectionBrush" Value="{telerik1:FluentResource ResourceKey=AccentMouseOverBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="CaretBrush" Value="{telerik1:FluentResource ResourceKey=MarkerMouseOverBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <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="TextBox">
                    <Grid x:Name="root">
                        <Border x:Name="BorderVisual"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"/>
                        <Border x:Name="ReadOnlyVisual"
                                Background="{telerik1:FluentResource ResourceKey=ReadOnlyBackgroundBrush}"
                                BorderBrush="{x:Null}"
                                BorderThickness="{telerik1:FluentResource ResourceKey=FocusThickness}"
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"
                                IsHitTestVisible="False"
                                Visibility="Collapsed"/>
                        <Border x:Name="FocusVisual"
                                Background="{x:Null}"
                                BorderBrush="{TemplateBinding mat:MaterialAssist.FocusBrush}"
                                BorderThickness="{telerik1:FluentResource ResourceKey=FocusThickness}"
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"
                                IsHitTestVisible="False"
                                Visibility="Collapsed"/>
                        <ScrollViewer x:Name="PART_ContentHost"
                                Margin="{TemplateBinding BorderThickness}"
                                Padding="{TemplateBinding Padding}"
                                Foreground="{TemplateBinding Foreground}"
                                BorderBrush="Transparent"
                                BorderThickness="0"
                                Opacity="{telerik1:FluentResource ResourceKey=InputOpacity}"
                                Background="Transparent"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>

                        <!-- MouseOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerMouseOverBrush}"/>
                            <Setter TargetName="PART_ContentHost" Property="Opacity" Value="1"/>
                            <Setter TargetName="BorderVisual" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush), Mode=OneWay}"/>
                        </Trigger>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter TargetName="BorderVisual" Property="BorderThickness" Value="{telerik1:FluentResource ResourceKey=FocusThickness}"/>
                            <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=ReadOnlyBorderBrush}"/>
                            <Setter TargetName="PART_ContentHost" Property="Opacity" Value="{telerik1:FluentResource ResourceKey=ReadOnlyOpacity}"/>
                            <Setter TargetName="ReadOnlyVisual" Property="Visibility" Value="Visible"/>
                        </Trigger>

                        <!-- Focused -->
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerMouseOverBrush}"/>
                            <Setter TargetName="BorderVisual" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush), Mode=OneWay}"/>
                            <Setter TargetName="FocusVisual" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_ContentHost" Property="Opacity" Value="1"/>
                        </Trigger>

                        <!-- Invalid -->
                        <Trigger Property="Validation.HasError" Value="True">
                            <Setter TargetName="FocusVisual" Property="Visibility" Value="Collapsed"/>
                        </Trigger>

                        <!-- Disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="PART_ContentHost" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}"/>
    <Style x:Key="RadButtonStyle" TargetType="telerik1:RadButton">
        <Setter Property="mat:MaterialAssist.CornerRadius" Value="{telerik1:FluentResource ResourceKey=CornerRadius}"/>
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik1:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="mat:MaterialAssist.PressedBrush" Value="{telerik1:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="mat:MaterialAssist.FocusBrush" Value="{telerik1:FluentResource ResourceKey=AccentFocusedBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <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>
                        <Border x:Name="BorderVisual"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"/>
                        <Border x:Name="FocusVisual"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Collapsed"
                                IsHitTestVisible="False"
                                BorderThickness="{telerik1:FluentResource ResourceKey=FocusThickness}"
                                BorderBrush="{TemplateBinding mat:MaterialAssist.FocusBrush}"
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"/>
                        <mat:FluentControl
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch">
                            <ContentPresenter x:Name="Content"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    RecognizesAccessKey="True"
                                    Focusable="False"
                                    TextBlock.Foreground="{TemplateBinding Foreground}"
                                    Margin="{TemplateBinding Padding}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                    ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </mat:FluentControl>
                    </Grid>
                    <ControlTemplate.Triggers>

                        <!-- background is hidden -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsBackgroundVisible" Value="False"/>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsMouseOver" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderBrush" Value="Transparent"/>
                        </MultiTrigger>

                        <!-- General IsKeyboardFocused setters -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsKeyboardFocused" Value="True"/>
                                <Condition Property="IsPressed" Value="False"/>
                                <Condition Property="IsMouseOver" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" TargetName="FocusVisual" Value="Visible"/>
                        </MultiTrigger>

                        <!-- general setters for IsMouseOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="BorderVisual" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush), Mode=OneWay}"/>
                            <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush), Mode=OneWay}"/>
                        </Trigger>

                        <!-- general setters for IsPressed -->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="BorderVisual" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.PressedBrush), Mode=OneWay}"/>
                            <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.PressedBrush), Mode=OneWay}"/>
                        </Trigger>

                        <!-- disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Content" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
                            <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=AlternativeBrush}"/>
                            <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=AlternativeBrush}"/>
                        </Trigger>

                        <!-- disabled and focused -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="False"/>
                                <Condition Property="IsFocused" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="FocusVisual" Property="Visibility" Value="Collapsed"/>
                        </MultiTrigger>

                        <!-- disabled & background is hidden -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="False"/>
                                <Condition Property="IsBackgroundVisible" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderBrush" Value="Transparent"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerik1:RadButton" BasedOn="{StaticResource RadButtonStyle}"/>
    <Style x:Key="RadRadioButtonStyle" TargetType="telerik1:RadRadioButton">
        <Setter Property="mat:MaterialAssist.CornerRadius" Value="{telerik1:FluentResource ResourceKey=CornerRadius}"/>
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik1:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="mat:MaterialAssist.PressedBrush" Value="{telerik1:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="mat:MaterialAssist.FocusBrush" Value="{telerik1:FluentResource ResourceKey=AccentFocusedBrush}"/>
        <Setter Property="mat:MaterialAssist.CheckedBrush" Value="{telerik1:FluentResource ResourceKey=AccentBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationTooltipTemplate}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik1:RadRadioButton">
                    <Grid>
                        <Border x:Name="BorderVisual"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"/>
                        <Border x:Name="FocusVisual"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="Collapsed"
                                IsHitTestVisible="False"
                                BorderThickness="{telerik1:FluentResource ResourceKey=FocusThickness}"
                                Background="{x:Null}"
                                BorderBrush="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.FocusBrush)}"
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"/>
                        <mat:FluentControl
                                CornerRadius="{TemplateBinding mat:MaterialAssist.CornerRadius}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsSmartClipped="True">
                            <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"/>
                        </mat:FluentControl>
                    </Grid>
                    <ControlTemplate.Triggers>

                        <!-- background is hidden -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsBackgroundVisible" Value="False"/>
                                <Condition Property="IsEnabled" Value="True"/>
                                <Condition Property="IsMouseOver" Value="False"/>
                                <Condition Property="IsChecked" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderBrush" Value="Transparent"/>
                        </MultiTrigger>

                        <!-- general setters for IsChecked -->
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerInvertedBrush}"/>
                            <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik1:FluentResource ResourceKey=AccentMouseOverBrush}"/>
                            <Setter Property="mat:MaterialAssist.PressedBrush" Value="{telerik1:FluentResource ResourceKey=AccentPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
                            <Setter Property="Background" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
                        </Trigger>

                        <!-- general setters for IsKeyboardFocused -->
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="FocusVisual" Property="Visibility" Value="Visible"/>
                        </Trigger>

                        <!-- General setters for IsMouseOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush), Mode=OneWay}"/>
                            <Setter Property="Background" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush), Mode=OneWay}"/>
                        </Trigger>

                        <!-- General setters for IsPressed -->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.PressedBrush), Mode=OneWay}"/>
                            <Setter Property="Background" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.PressedBrush), Mode=OneWay}"/>
                        </Trigger>

                        <!-- disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=AlternativeBrush}"/>
                            <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=AlternativeBrush}"/>
                            <Setter TargetName="Content" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
                        </Trigger>

                        <!-- disabled and focused -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="False"/>
                                <Condition Property="IsFocused" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="FocusVisual" Property="Visibility" Value="Collapsed"/>
                        </MultiTrigger>

                        <!-- disabled & checked -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="False"/>
                                <Condition Property="IsBackgroundVisible" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderBrush" Value="Transparent"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="telerik1:RadRadioButton" BasedOn="{StaticResource RadRadioButtonStyle}"/>
    <Style TargetType="dataPager:DataPagerTextBox" BasedOn="{StaticResource TextBoxStyle}"/>

    <!-- PageButton Style -->
    <Style x:Key="PageButtonStyle" TargetType="telerik:RadButton" BasedOn="{StaticResource RadButtonStyle}">
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="Padding" Value="4"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="MinWidth" Value="28"/>
        <Setter Property="MinHeight" Value="28"/>
        <Setter Property="IsBackgroundVisible" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

    <!-- PageStyle -->
    <Style x:Key="RadPageStyle" TargetType="telerik:RadRadioButton" BasedOn="{StaticResource RadRadioButtonStyle}">
        <Setter Property="MinWidth" Value="28"/>
        <Setter Property="MinHeight" Value="28"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="IsBackgroundVisible" Value="False"/>
    </Style>
    <ControlTemplate x:Key="NumericElementsPresenterTemplate" TargetType="dataPager:NumericElementsPresenter">
        <ItemsControl ItemsSource="{Binding Pages}" SnapsToDevicePixels="True" FocusVisualStyle="{x:Null}" IsTabStop="False">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <telerik:RadRadioButton
                            IsChecked="{Binding IsCurrent, Mode=OneWay}"
                            GroupName="{Binding GroupName}"
                            CommandParameter="{Binding PageIndex}"
                            Command="{x:Static controls:RadDataPagerCommands.MoveToPage}"
                            Content="{Binding Content}"
                            Style="{Binding NumericButtonStyle}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </ControlTemplate>
    <Style x:Key="NumericElementsPresenterStyle" TargetType="dataPager:NumericElementsPresenter">
        <Setter Property="Template" Value="{StaticResource NumericElementsPresenterTemplate}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="IsTabStop" Value="False"/>
    </Style>
    <ControlTemplate x:Key="DataPagerPresenterTemplate" TargetType="dataPager:DataPagerPresenter">
        <Border
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                Padding="{TemplateBinding Padding}">
            <Grid Background="Transparent" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <StackPanel
                        Orientation="Horizontal"
                        Background="Transparent"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">

                    <!-- FirstPage Button -->
                    <telerik:RadButton
                            Name="MoveToFirstPageButton"
                            Style="{StaticResource PageButtonStyle}"
                            Command="{x:Static controls:RadDataPagerCommands.MoveToFirstPage}"
                            Visibility="{Binding PagerControlsVisibility.MoveToFirstPageControlVisibility, RelativeSource={RelativeSource TemplatedParent}}">
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowBackward}"/>
                    </telerik:RadButton>

                    <!-- PreviousPage Button -->
                    <telerik:RadButton
                            Name="MoveToPreviousPageButton"
                            Style="{StaticResource PageButtonStyle}"
                            Command="{x:Static controls:RadDataPagerCommands.MoveToPreviousPage}"
                            Visibility="{Binding PagerControlsVisibility.MoveToPreviousPageControlVisibility, RelativeSource={RelativeSource TemplatedParent}}">
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrow60Left}"/>
                    </telerik:RadButton>

                    <!-- NumericPresenter -->
                    <Border VerticalAlignment="Center" Visibility="{Binding PagerControlsVisibility.NumericElementsControlVisibility,RelativeSource={RelativeSource TemplatedParent}}">
                        <dataPager:NumericElementsPresenter
                                NumericButtonStyle="{TemplateBinding NumericButtonStyle}"
                                AutoEllipsisMode="{TemplateBinding AutoEllipsisMode}"
                                PageIndex="{TemplateBinding PageIndex}"
                                PageCount="{TemplateBinding PageCount}"
                                NumericButtonCount="{TemplateBinding NumericButtonCount}"/>
                    </Border>

                    <!-- NextPage Button -->
                    <telerik:RadButton
                            Name="MoveToNextPageButton"
                            Style="{StaticResource PageButtonStyle}"
                            Command="{x:Static controls:RadDataPagerCommands.MoveToNextPage}"
                            Visibility="{Binding PagerControlsVisibility.MoveToNextPageControlVisibility, RelativeSource={RelativeSource TemplatedParent}}">
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrow60Right}"/>
                    </telerik:RadButton>

                    <!-- LastPage Button -->
                    <telerik:RadButton
                            Name="MoveToLastPageButton"
                            Style="{StaticResource PageButtonStyle}"
                            Command="{x:Static controls:RadDataPagerCommands.MoveToLastPage}"
                            Visibility="{Binding PagerControlsVisibility.MoveToLastPageControlVisibility, RelativeSource={RelativeSource TemplatedParent}}">
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowForward}"/>
                    </telerik:RadButton>
                </StackPanel>
                <Grid
                        Background="Transparent"
                        Grid.Column="1"
                        Visibility="{Binding PagerControlsVisibility.TextControlVisibility,RelativeSource={RelativeSource TemplatedParent}}"
                        Margin="4 0 0 0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock telerik:LocalizationManager.ResourceKey="RadDataPagerPage" TextAlignment="Center" VerticalAlignment="Center" Margin="4 0"/>
                    <dataPager:DataPagerTextBox
                            Grid.Column="1"
                            VerticalAlignment="Center"
                            x:Name="DataPagerTextBox"
                            AutomationProperties.Name="DataPagerTextBox"
                            Command="{x:Static controls:RadDataPagerCommands.MoveToPage}"
                            PageIndex="{TemplateBinding PageIndex}"
                            MinWidth="28"
                            MinHeight="28"/>
                    <TextBlock Grid.Column="2" telerik:LocalizationManager.ResourceKey="RadDataPagerOf" TextAlignment="Center" VerticalAlignment="Center" Margin="4 0"/>
                    <TextBlock Grid.Column="3" Text="{Binding PageCount, RelativeSource={RelativeSource TemplatedParent}}" TextAlignment="Center" VerticalAlignment="Center" Margin="4 0"/>
                </Grid>
            </Grid>
        </Border>
    </ControlTemplate>
    <Style x:Key="DataPagerPresenterStyle" TargetType="dataPager:DataPagerPresenter">
        <Setter Property="Template" Value="{StaticResource DataPagerPresenterTemplate}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Padding" Value="2 0"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <ControlTemplate x:Key="RadDataPagerTemplate" TargetType="controls:RadDataPager">
        <dataPager:DataPagerPresenter
                NumericButtonStyle="{TemplateBinding NumericButtonStyle}"
                AutoEllipsisMode="{TemplateBinding AutoEllipsisMode}"
                DisplayMode="{TemplateBinding DisplayMode}"
                PageIndex="{TemplateBinding PageIndex}"
                PageCount="{TemplateBinding PageCount}"
                NumericButtonCount="{TemplateBinding NumericButtonCount}"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                PageSize="{Binding PageSize, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                ItemCount="{Binding ItemCount, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                SnapsToDevicePixels="True"
                FocusVisualStyle="{x:Null}"/>
    </ControlTemplate>
    <Style x:Key="RadDataPagerStyle" TargetType="controls:RadDataPager">
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="NumericButtonStyle" Value="{StaticResource RadPageStyle}"/>
        <Setter Property="Template" Value="{StaticResource RadDataPagerTemplate}"/>
    </Style>
    <Style TargetType="controls:RadDataPager" BasedOn="{StaticResource RadDataPagerStyle}"/>
    <Style TargetType="dataPager:DataPagerPresenter" BasedOn="{StaticResource DataPagerPresenterStyle}"/>
    <Style TargetType="dataPager:NumericElementsPresenter" BasedOn="{StaticResource NumericElementsPresenterStyle}"/>
    <DataTemplate x:Key="FilterOperatorTemplate">
        <TextBlock Text="{Binding Converter={StaticResource FilterOperatorConverter}}"/>
    </DataTemplate>
    <ControlTemplate TargetType="telerik:RadToggleButton" x:Key="ToggleFilterButtonTemplate">
        <Grid>
            <ContentControl x:Name="Content"
                    Margin="{TemplateBinding Padding}"
                    Content="{TemplateBinding Content}"
                    Foreground="{TemplateBinding Foreground}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="ToggleFilterButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="Template" Value="{StaticResource ToggleFilterButtonTemplate}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="8 4"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <ControlTemplate x:Key="RemoveFilterButtonTemplate" TargetType="telerik:RadButton">
        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
            <telerik:RadGlyph x:Name="GlyphVisual"
                    Foreground="{TemplateBinding Foreground}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="16"
                    Glyph="{StaticResource GlyphClose}"/>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="GlyphVisual" Property="Foreground" Value="{telerik1:FluentResource ResourceKey=ValidationBrush}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="GlyphVisual" Property="Foreground" Value="{telerik1:FluentResource ResourceKey=ValidationBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="RemoveFilterButtonStyle" TargetType="telerik:RadButton">
        <Setter Property="Template" Value="{StaticResource RemoveFilterButtonTemplate}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Width" Value="28"/>
        <Setter Property="Height" Value="28"/>
    </Style>
    <ControlTemplate x:Key="AddFilterButtonTemplate" TargetType="telerik:RadButton">
        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
            <telerik:RadGlyph x:Name="GlyphVisual"
                    Foreground="{TemplateBinding Foreground}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontSize="16"
                    Glyph="{StaticResource GlyphPlus}"/>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="GlyphVisual" Property="Foreground" Value="{telerik1:FluentResource ResourceKey=AccentMouseOverBrush}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="GlyphVisual" Property="Foreground" Value="{telerik1:FluentResource ResourceKey=AccentPressedBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="AddFilterButtonStyle" TargetType="telerik:RadButton">
        <Setter Property="Template" Value="{StaticResource AddFilterButtonTemplate}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Width" Value="28"/>
        <Setter Property="Height" Value="28"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <ControlTemplate x:Key="FilterControlTemplate" TargetType="dataFilter:FilterControl">
        <Border x:Name="OuterBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <StackPanel Orientation="Horizontal">
                <telerik:RadButton x:Name="PART_RemoveFilterButton" Command="{Binding RemoveFilter}" Style="{StaticResource RemoveFilterButtonStyle}"/>
                <StackPanel Orientation="Horizontal" Visibility="{Binding IsComposite, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <telerik:RadToggleButton
                            Name="PART_CompositeFilterLogicalOperatorToggleButton"
                            Style="{StaticResource ToggleFilterButtonStyle}"
                            IsChecked="{Binding CompositeFilter.LogicalOperator, Mode=TwoWay, Converter={StaticResource LogicalOperatorToCheckedConverter}}"
                            Content="{Binding CompositeFilter.LogicalOperator, Converter={StaticResource LogicalOperatorConverter}}"/>
                    <telerik:RadButton x:Name="PART_AddFilterButton" Command="{Binding AddFilter}" Style="{StaticResource AddFilterButtonStyle}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Visibility="{Binding IsComposite, Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
                    <telerik:RadComboBox
                            Name="PART_SimpleFilterMemberComboBox"
                            VerticalAlignment="Stretch"
                            AutomationProperties.Name="SimpleFilterMemberComboBox"
                            Margin="0 0 5 0"
                            MinWidth="120"
                            ItemsSource="{Binding SimpleFilter.AvailableMembers}"
                            SelectedItem="{Binding SimpleFilter.SelectedMember, Mode=TwoWay}"/>
                    <telerik:RadComboBox
                            Name="PART_SimpleFilterOperatorComboBox"
                            AutomationProperties.Name="SimpleFilterOperatorComboBox"
                            VerticalAlignment="Stretch"
                            Margin="0 0 5 0"
                            MinWidth="120"
                            ItemsSource="{Binding SimpleFilter.AvailableOperators}"
                            SelectedItem="{Binding SimpleFilter.Operator, Mode=TwoWay, Converter={StaticResource FilterOperatorToSelectedItemConverter}}"
                            IsEnabled="{Binding SimpleFilter.Member, Converter={StaticResource FilterMemberToEnabledConverter}}"
                            ItemTemplate="{StaticResource FilterOperatorTemplate}"/>
                    <dataFilter:FilterEditor x:Name="filterEditor"
                            DataContext="{Binding SimpleFilter}"
                            ItemPropertyDefinition="{Binding SelectedMember}"
                            FilterOperator="{Binding Operator}"
                            HorizontalContentAlignment="Stretch"
                            IsTabStop="False"
                            MinHeight="28"
                            VerticalContentAlignment="Stretch"/>
                    <Border Width="5" BorderBrush="Transparent" Visibility="{Binding CanUserCreateCompositeFilters, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"/>
                    <telerik:RadButton x:Name="PART_ToCompositeFilterButton"
                            Command="{Binding ToCompositeFilter}"
                            Style="{StaticResource AddFilterButtonStyle}"
                            Visibility="{Binding CanUserCreateCompositeFilters, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                </StackPanel>
            </StackPanel>
        </Border>
    </ControlTemplate>
    <Style x:Key="FilterControlStyle" TargetType="dataFilter:FilterControl">
        <Setter Property="Template" Value="{StaticResource FilterControlTemplate}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
    </Style>
    <ControlTemplate x:Key="DataFilterPresenterTemplate" TargetType="dataFilter:DataFilterPresenter">
        <Border Padding="{TemplateBinding Padding}">
            <Grid x:Name="Root">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ContentControl x:Name="HeaderContent"
                        Grid.Row="0"
                        Content="{TemplateBinding Header}"
                        VerticalAlignment="Stretch"
                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                        IsTabStop="False"/>
                <ItemsPresenter x:Name="Items" Grid.Row="1"/>
            </Grid>
        </Border>
    </ControlTemplate>
    <HierarchicalDataTemplate x:Key="DataFilterPresenterItemTemplate" ItemsSource="{Binding CompositeFilter.Filters}">
        <dataFilter:FilterControl/>
    </HierarchicalDataTemplate>
    <DataTemplate x:Key="DataFilterPresenterHeaderTemplate">
        <dataFilter:FilterControl/>
    </DataTemplate>
    <Style x:Key="DataFilterPresenterStyle" TargetType="dataFilter:DataFilterPresenter">
        <Setter Property="Template" Value="{StaticResource DataFilterPresenterTemplate}"/>
        <Setter Property="ItemTemplate" Value="{StaticResource DataFilterPresenterItemTemplate}"/>
        <Setter Property="HeaderTemplate" Value="{StaticResource DataFilterPresenterHeaderTemplate}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Padding" Value="20 2 0 2"/>
    </Style>
    <ControlTemplate x:Key="RadDataFilterTemplate" TargetType="controls:RadDataFilter">
        <ScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0">
            <dataFilter:DataFilterPresenter DataContext="{TemplateBinding ViewModel}" Header="{Binding .}" ItemsSource="{Binding CompositeFilter.Filters}"/>
        </ScrollViewer>
    </ControlTemplate>
    <Style x:Key="RadDataFilterStyle" TargetType="controls:RadDataFilter">
        <Setter Property="Template" Value="{StaticResource RadDataFilterTemplate}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style TargetType="controls:RadDataFilter" BasedOn="{StaticResource RadDataFilterStyle}"/>
    <Style TargetType="dataFilter:FilterControl" BasedOn="{StaticResource FilterControlStyle}"/>
    <Style TargetType="dataFilter:DataFilterPresenter" BasedOn="{StaticResource DataFilterPresenterStyle}"/>
    <Style x:Key="SingleLabelStyle" TargetType="ContentControl">
        <Setter Property="MinHeight" Value="26"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <ContentPresenter
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Content="{TemplateBinding Content}"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="DataFormValidationSummaryTemplate" TargetType="dataForm:DataFormValidationSummary">
        <ItemsControl IsTabStop="False" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Errors}">
            <ItemsControl.Style>
                <Style TargetType="ItemsControl">
                    <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicBrush}"/>
                    <Setter Property="BorderThickness" Value="0 1 0 0"/>
                    <Setter Property="Padding" Value="5"/>
                    <Setter Property="MaxHeight" Value="90"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <ScrollViewer x:Name="ScrollViewer"
                                        IsTabStop="False"
                                        ScrollViewer.VerticalScrollBarVisibility="Auto"
                                        ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}">
                                    <ItemsPresenter x:Name="Content" Margin="{TemplateBinding Padding}"/>
                                </ScrollViewer>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="ItemTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                    <TextBlock Foreground="{telerik1:FluentResource ResourceKey=ValidationBrush}" Text="{Binding SourceFieldDisplayName}"/>
                                    <TextBlock Text=":" Margin="4 0" Foreground="{telerik1:FluentResource ResourceKey=ValidationBrush}"/>
                                    <TextBlock Text="{Binding ErrorContent}"/>
                                </StackPanel>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding HasItems, RelativeSource={RelativeSource Self}}" Value="False">
                            <Setter Property="Padding" Value="0"/>
                            <Setter Property="BorderThickness" Value="0"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ItemsControl.Style>
        </ItemsControl>
    </ControlTemplate>
    <Style x:Key="DataFormValidationSummaryStyle" TargetType="dataForm:DataFormValidationSummary">
        <Setter Property="Template" Value="{StaticResource DataFormValidationSummaryTemplate}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="IsTabStop" Value="False"/>
    </Style>
    <Style TargetType="telerik:RadButton" x:Key="CollectionNavigatorButtonStyle" BasedOn="{StaticResource RadButtonStyle}">
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="IsBackgroundVisible" Value="False"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Width" Value="28"/>
        <Setter Property="Height" Value="28"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="CornerRadius" Value="{telerik1:FluentResource ResourceKey=CornerRadius}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <ControlTemplate x:Key="CollectionNavigatorTemplate" TargetType="dataForm:CollectionNavigator">
        <Border x:Name="PART_RootElement"
                BorderThickness="{TemplateBinding BorderThickness}"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                UseLayoutRounding="True">
            <Grid x:Name="PART_CollectionNavigatorGrid" Margin="{TemplateBinding Padding}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <telerik:RadButton x:Name="MoveCurrentToFirst"
                            Style="{StaticResource CollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadDataFormCommands.MoveCurrentToFirst}"
                            Visibility="{Binding NavigationButtonsVisibility}"
                            RenderTransformOrigin="0.5 0.5">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToFirst"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowBackward}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="MoveCurrentToPrevious"
                            Style="{StaticResource CollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadDataFormCommands.MoveCurrentToPrevious}"
                            Visibility="{Binding NavigationButtonsVisibility}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToPrevious"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrow60Left}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="MoveCurrentToNext"
                            Style="{StaticResource CollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadDataFormCommands.MoveCurrentToNext}"
                            Visibility="{Binding NavigationButtonsVisibility}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToNext"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrow60Right}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="MoveCurrentToLast"
                            Style="{StaticResource CollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadDataFormCommands.MoveCurrentToLast}"
                            Visibility="{Binding NavigationButtonsVisibility}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToLast"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowForward}"/>
                    </telerik:RadButton>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                    <telerik:RadButton x:Name="AddNew"
                            Style="{StaticResource CollectionNavigatorButtonStyle}"
                            Visibility="{Binding AddNewButtonVisibility}"
                            Command="{x:Static controls:RadDataFormCommands.AddNew}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_AddNew"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphFile}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="BeginEdit"
                            Command="{x:Static controls:RadDataFormCommands.BeginEdit}"
                            Style="{StaticResource CollectionNavigatorButtonStyle}"
                            Visibility="{Binding EditButtonVisibility}"
                            RenderTransformOrigin="0.5 0.5">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_BeginEdit"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphEdit}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="Delete"
                            Command="{x:Static controls:RadDataFormCommands.Delete}"
                            Style="{StaticResource CollectionNavigatorButtonStyle}"
                            Visibility="{Binding DeleteButtonVisibility}"
                            RenderTransformOrigin="0.5 0.5">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_Delete"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphDelete}"/>
                    </telerik:RadButton>
                </StackPanel>
            </Grid>
        </Border>
    </ControlTemplate>
    <Style x:Key="CollectionNavigatorStyle" TargetType="dataForm:CollectionNavigator">
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Template" Value="{StaticResource CollectionNavigatorTemplate}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="IsTabStop" Value="False"/>
    </Style>
    <ControlTemplate x:Key="AutoGeneratedFieldsPresenterTemplate" TargetType="dataForm:AutoGeneratedFieldsPresenter">
        <ItemsControl IsTabStop="False" ItemsSource="{TemplateBinding Fields}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>
    </ControlTemplate>
    <Style x:Key="AutoGeneratedFieldsPresenterStyle" TargetType="dataForm:AutoGeneratedFieldsPresenter">
        <Setter Property="Template" Value="{StaticResource AutoGeneratedFieldsPresenterTemplate}"/>
        <Setter Property="IsTabStop" Value="False"/>
    </Style>
    <ControlTemplate x:Key="DataFormDataFieldTemplate" TargetType="controls:DataFormDataField">
        <Border x:Name="PART_RootElement"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                UseLayoutRounding="True">
            <Grid x:Name="PART_DataFormDataFieldGrid" Margin="{TemplateBinding Padding}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="32"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <ContentControl x:Name="PART_Label"
                        IsTabStop="False"
                        Margin="0 4 8 0"
                        VerticalAlignment="Center"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        Content="{TemplateBinding Label}"
                        Foreground="{TemplateBinding Foreground}"
                        FontWeight="Medium"
                        ContentTemplate="{TemplateBinding LabelTemplate}"/>
                <ContentPresenter
                        Grid.Row="1"
                        x:Name="PART_ContentPresenter"
                        Grid.Column="1"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        Margin="0 0 16 0"/>
                <Grid
                        Grid.Row="1"
                        x:Name="DescriptionIcon"
                        Grid.Column="2"
                        Visibility="{Binding Description, Converter={StaticResource DescriptionVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Background="Transparent">
                    <ToolTipService.ToolTip>
                        <ToolTip Content="{TemplateBinding Description}"/>
                    </ToolTipService.ToolTip>
                    <telerik:RadGlyph
                            Foreground="{telerik1:FluentResource ResourceKey=IconBrush}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            FontSize="32"
                            Glyph="{StaticResource GlyphQuestion}"/>
                </Grid>
            </Grid>
        </Border>
    </ControlTemplate>
    <Style x:Key="DataFormDataFieldStyle" TargetType="controls:DataFormDataField">
        <Setter Property="Template" Value="{StaticResource DataFormDataFieldTemplate}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="4 0 4 4"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsEditing, RelativeSource={RelativeSource Self}}" Value="True">
                <Setter Property="IsTabStop" Value="False"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding EditMode, RelativeSource={RelativeSource AncestorType={x:Type controls:RadDataForm}}}" Value="Default">
                <Setter Property="IsTabStop" Value="False"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Mode, RelativeSource={RelativeSource AncestorType={x:Type controls:RadDataForm}}}" Value="ReadOnly">
                <Setter Property="IsTabStop" Value="False"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <ControlTemplate x:Key="RadDataFormTemplate" TargetType="controls:RadDataForm">
        <Border x:Name="PART_RootElement" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" UseLayoutRounding="True">
            <Grid x:Name="PART_DataFormGrid">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border x:Name="BorderVisual" Background="{TemplateBinding Background}" Grid.RowSpan="5"/>
                <Border x:Name="Header"
                        Visibility="{Binding Header, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DescriptionVisibilityConverter}}"
                        MinHeight="31"
                        Background="{telerik1:FluentResource ResourceKey=MainBrush}">
                    <ContentControl x:Name="PART_ContentPresenter"
                            Margin="10 0"
                            VerticalContentAlignment="Top"
                            HorizontalContentAlignment="Stretch"
                            Content="{TemplateBinding Header}"
                            Foreground="{telerik1:FluentResource ResourceKey=MarkerBrush}"
                            VerticalAlignment="Center"/>
                </Border>
                <dataForm:CollectionNavigator x:Name="CollectionNavigator" Grid.Row="1"/>
                <ScrollViewer x:Name="PART_ItemsScrollViewer"
                        Grid.Row="2"
                        IsTabStop="False"
                        BorderBrush="Transparent"
                        Padding="{TemplateBinding Padding}"
                        ScrollViewer.HorizontalScrollBarVisibility="Auto"
                        ScrollViewer.VerticalScrollBarVisibility="Auto">
                    <StackPanel Orientation="Vertical">
                        <dataForm:AutoGeneratedFieldsPresenter x:Name="PART_AutoGeneratedFieldsPresenter" AutoGenerateFields="{Binding AutoGenerateFields,RelativeSource={RelativeSource TemplatedParent}}"/>
                        <ContentPresenter x:Name="PART_FieldsContentPresenter"/>
                    </StackPanel>
                </ScrollViewer>
                <dataForm:DataFormValidationSummary x:Name="PART_ValidationSummary" Grid.Row="3" Visibility="{TemplateBinding ValidationSummaryVisibility}"/>
                <Border x:Name="FooterPanel_Background" Grid.Row="4" Background="{telerik1:FluentResource ResourceKey=MainBrush}">
                    <StackPanel x:Name="PART_FooterPanel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 4">
                        <telerik:RadButton x:Name="PART_CommitButton"
                                Command="{x:Static controls:RadDataFormCommands.CommitEdit}"
                                MinWidth="65"
                                Margin="0 0 5 0"
                                Content="{TemplateBinding CommitButtonContent}"
                                VerticalAlignment="Center"/>
                        <telerik:RadButton x:Name="PART_CancelButton"
                                Command="{x:Static controls:RadDataFormCommands.CancelEdit}"
                                MinWidth="65"
                                Margin="0 0 5 0"
                                Content="{TemplateBinding CancelButtonContent}"
                                VerticalAlignment="Center"/>
                    </StackPanel>
                </Border>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="PART_DataFormGrid" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="RadDataFormStyle" TargetType="controls:RadDataForm">
        <Setter Property="Template" Value="{StaticResource RadDataFormTemplate}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Style.Triggers>
            <Trigger Property="EditMode" Value="Single">
                <Setter Property="LabelStyle" Value="{StaticResource SingleLabelStyle}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="controls:RadDataForm" BasedOn="{StaticResource RadDataFormStyle}"/>
    <Style TargetType="controls:DataFormDataField" BasedOn="{StaticResource DataFormDataFieldStyle}"/>
    <Style TargetType="dataForm:CollectionNavigator" BasedOn="{StaticResource CollectionNavigatorStyle}"/>
    <Style TargetType="dataForm:AutoGeneratedFieldsPresenter" BasedOn="{StaticResource AutoGeneratedFieldsPresenterStyle}"/>
    <Style TargetType="dataForm:DataFormValidationSummary" BasedOn="{StaticResource DataFormValidationSummaryStyle}"/>
    <Style TargetType="controls:DataFormCheckBoxField" BasedOn="{StaticResource DataFormDataFieldStyle}"/>
    <Style TargetType="controls:DataFormComboBoxField" BasedOn="{StaticResource DataFormDataFieldStyle}"/>
    <Style TargetType="controls:DataFormDateField" BasedOn="{StaticResource DataFormDataFieldStyle}"/>
    <Style x:Key="RadCollectionNavigatorButtonStyle" TargetType="telerik:RadButton" BasedOn="{StaticResource RadButtonStyle}">
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="IsBackgroundVisible" Value="False"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Width" Value="28"/>
        <Setter Property="Height" Value="28"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <ControlTemplate x:Key="Collection_NavigatorTemplate" TargetType="controls:RadCollectionNavigator">
        <Border x:Name="PART_RootElement"
                BorderThickness="{TemplateBinding BorderThickness}"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                UseLayoutRounding="True">
            <Grid x:Name="PART_CollectionNavigatorGrid" Margin="{TemplateBinding Padding}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <telerik:RadButton x:Name="MoveCurrentToFirst"
                            Style="{StaticResource RadCollectionNavigatorButtonStyle}"
                            Visibility="{Binding Converter={StaticResource VisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, Path=CommandButtonsVisibility, ConverterParameter=first}"
                            Command="{x:Static controls:RadCollectionNavigatorCommands.MoveCurrentToFirst}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToFirst"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowBackward}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="MoveCurrentToPrevious"
                            Style="{StaticResource RadCollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadCollectionNavigatorCommands.MoveCurrentToPrevious}"
                            Visibility="{Binding Converter={StaticResource VisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, Path=CommandButtonsVisibility, ConverterParameter=previous}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToPrevious"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrow60Left}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="MoveCurrentToNext"
                            Style="{StaticResource RadCollectionNavigatorButtonStyle}"
                            Visibility="{Binding Converter={StaticResource VisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, Path=CommandButtonsVisibility, ConverterParameter=next}"
                            Command="{x:Static controls:RadCollectionNavigatorCommands.MoveCurrentToNext}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToNext"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrow60Right}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="MoveCurrentToLast"
                            Style="{StaticResource RadCollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadCollectionNavigatorCommands.MoveCurrentToLast}"
                            Visibility="{Binding Converter={StaticResource VisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, Path=CommandButtonsVisibility, ConverterParameter=last}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_MoveCurrentToLast"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowForward}"/>
                    </telerik:RadButton>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                    <telerik:RadButton x:Name="AddNew"
                            Style="{StaticResource RadCollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadCollectionNavigatorCommands.AddNew}"
                            Visibility="{Binding Converter={StaticResource VisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, Path=CommandButtonsVisibility, ConverterParameter=add}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_AddNew"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphFile}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="BeginEdit"
                            Style="{StaticResource RadCollectionNavigatorButtonStyle}"
                            Command="{x:Static controls:RadCollectionNavigatorCommands.BeginEdit}"
                            Visibility="{Binding Converter={StaticResource VisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, Path=CommandButtonsVisibility, ConverterParameter=edit}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_BeginEdit"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphEdit}"/>
                    </telerik:RadButton>
                    <telerik:RadButton x:Name="Delete"
                            Style="{StaticResource RadCollectionNavigatorButtonStyle}"
                            Visibility="{Binding Converter={StaticResource VisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, Path=CommandButtonsVisibility, ConverterParameter=delete}"
                            Command="{x:Static controls:RadCollectionNavigatorCommands.Delete}">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="DataForm_Delete"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphDelete}"/>
                    </telerik:RadButton>
                </StackPanel>
            </Grid>
        </Border>
    </ControlTemplate>
    <Style x:Key="RadCollectionNavigatorStyle" TargetType="controls:RadCollectionNavigator">
        <Setter Property="Template" Value="{StaticResource Collection_NavigatorTemplate}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="2 0"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style TargetType="controls:RadCollectionNavigator" BasedOn="{StaticResource RadCollectionNavigatorStyle}"/>
    <ControlTemplate x:Key="ModalEditor_Template" TargetType="propertyGrid:ModalEditor">
        <Border
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                CornerRadius="{telerik1:FluentResource ResourceKey=CornerRadius}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Border x:Name="InnerBackground">
                    <TextBlock x:Name="PART_ModalEditorTextBlock"
                            Text="{Binding SourceProperty, RelativeSource={RelativeSource TemplatedParent}}"
                            Opacity="{telerik1:FluentResource ResourceKey=InputOpacity}"
                            Margin="5 0 0 0"
                            VerticalAlignment="Center"/>
                </Border>
                <telerik:RadButton x:Name="PART_ShowEditorButton"
                        Grid.Column="1"
                        BorderThickness="0"
                        Padding="0"
                        IsBackgroundVisible="False"
                        Width="28"
                        Height="28"
                        Command="{x:Static propertyGrid:ModalEditor.ShowEditorCommand}">
                    <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphEdit}"/>
                </telerik:RadButton>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True" SourceName="InnerBackground">
                <Setter TargetName="InnerBackground" Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryMouseOverBrush}"/>
                <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerMouseOverBrush}"/>
                <Setter TargetName="PART_ModalEditorTextBlock" Property="Opacity" Value="1"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="ModalEditorStyle" TargetType="propertyGrid:ModalEditor">
        <Setter Property="Template" Value="{StaticResource ModalEditor_Template}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="propertyGrid:ModalEditor" BasedOn="{StaticResource ModalEditorStyle}"/>
    <ControlTemplate x:Key="DropDownEditor_Template" TargetType="propertyGrid:DropDownEditor">
        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Border x:Name="InnerBackground">
                    <TextBlock x:Name="PART_DropDownEditorTextBlock"
                            Text="{Binding SourceProperty, RelativeSource={RelativeSource TemplatedParent}}"
                            Opacity="{telerik1:FluentResource ResourceKey=InputOpacity}"
                            Margin="5 0 0 0"
                            VerticalAlignment="Center"/>
                </Border>
                <telerik:RadDropDownButton x:Name="PART_DropDownEditorButton"
                        IsEnabled="{TemplateBinding IsEnabled}"
                        Grid.Column="1"
                        IsBackgroundVisible="False"
                        Padding="0"
                        DropDownContent="{Binding Editor, RelativeSource={RelativeSource TemplatedParent}}"
                        PopupPlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                        BorderThickness="0"
                        MinWidth="28"
                        MinHeight="28"/>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True" SourceName="InnerBackground">
                <Setter TargetName="InnerBackground" Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryMouseOverBrush}"/>
                <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerMouseOverBrush}"/>
                <Setter TargetName="PART_DropDownEditorTextBlock" Property="Opacity" Value="1"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="DropDownEditorStyle" TargetType="propertyGrid:DropDownEditor">
        <Setter Property="Template" Value="{StaticResource DropDownEditor_Template}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <ControlTemplate x:Key="ToggleButtonTemplate" TargetType="telerik:RadToggleButton">
        <Border Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <Border
                    HorizontalAlignment="Center"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    VerticalAlignment="Center"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                <Grid>
                    <telerik:RadGlyph x:Name="Plus" Foreground="{TemplateBinding Foreground}" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphPlus}"/>
                    <telerik:RadGlyph x:Name="Minus"
                            Foreground="{TemplateBinding Foreground}"
                            FontSize="16"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Visibility="Collapsed"
                            Glyph="{StaticResource GlyphMinus}"/>
                </Grid>
            </Border>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=AccentMouseOverBrush}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=AccentPressedBrush}"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="True">
                <Setter TargetName="Plus" Property="Visibility" Value="Collapsed"/>
                <Setter TargetName="Minus" Property="Visibility" Value="Visible"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="PropertyGridNestedToggleButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="Template" Value="{StaticResource ToggleButtonTemplate}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Width" Value="31"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <ControlTemplate TargetType="telerik:RadToggleButton" x:Key="PropertyGridToggleButtonTemplate">
        <Grid UseLayoutRounding="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="Arrow"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="1 0 0 1"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"
                    Width="31"
                    Margin="0">
                <telerik:RadGlyph x:Name="Glyph"
                        Foreground="{telerik1:FluentResource ResourceKey=IconBrush}"
                        FontSize="16"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Glyph="{StaticResource GlyphArrowChevronDown}"/>
            </Border>
            <Border
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    Grid.ColumnSpan="2"
                    Grid.Column="1">
                <ContentControl x:Name="PART_ContentPresenter"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        Foreground="{TemplateBinding Foreground}"
                        Content="{TemplateBinding Content}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        Margin="{TemplateBinding Padding}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </Border>
            <Border x:Name="ExpandBorder"
                    Grid.ColumnSpan="2"
                    Grid.Column="1"
                    Opacity="0"
                    Background="Transparent"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter TargetName="Glyph" Property="Glyph" Value="{StaticResource GlyphArrowChevronUp}"/>
                <Setter TargetName="Arrow" Property="BorderThickness" Value="1 0 0 0"/>
                <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=AccentBrush}"/>
                <Setter TargetName="Glyph" Property="Foreground" Value="{telerik1:FluentResource ResourceKey=AccentBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style TargetType="telerik:RadToggleButton" x:Key="PropertyGridToggleButtonStyle">
        <Setter Property="Template" Value="{StaticResource PropertyGridToggleButtonTemplate}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="BorderThickness" Value="0 0 1 1"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="MinHeight" Value="31"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style x:Key="ItemsControlStyle" TargetType="ItemsControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ItemsControl">
                    <ScrollViewer Background="{x:Null}" BorderThickness="0" Margin="0" FocusVisualStyle="{x:Null}">
                        <ItemsPresenter/>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="VirtualizedItemsControlStyle" BasedOn="{StaticResource ItemsControlStyle}" TargetType="ItemsControl">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
    </Style>
    <DataTemplate x:Key="flatTemplate">
        <ItemsControl ItemsSource="{Binding Converter={StaticResource FlatItemSourceConverter}}" Style="{StaticResource ItemsControlStyle}" IsTabStop="False">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <propertyGrid:PropertyGridField Content="{Binding}" Visibility="{Binding Visibility}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>
    <DataTemplate x:Key="virtualizedFlatTemplate">
        <ItemsControl ItemsSource="{Binding Converter={StaticResource FlatItemSourceConverter}}" Style="{StaticResource VirtualizedItemsControlStyle}" IsTabStop="False">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <propertyGrid:PropertyGridField Content="{Binding}" Visibility="{Binding Visibility}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>
    <DataTemplate x:Key="flatRenderingTemplate">
        <ItemsControl VirtualizingStackPanel.VirtualizationMode="Standard" ItemsSource="{Binding}" Style="{StaticResource VirtualizedItemsControlStyle}" IsTabStop="False">
            <ItemsControl.ItemTemplateSelector>
                <propertyGrid:FlatRenderingItemTemplateSelector>
                    <propertyGrid:FlatRenderingItemTemplateSelector.FieldTemplate>
                        <DataTemplate>
                            <propertyGrid:PropertyGridField Content="{Binding}" Visibility="{Binding Visibility}"/>
                        </DataTemplate>
                    </propertyGrid:FlatRenderingItemTemplateSelector.FieldTemplate>
                    <propertyGrid:FlatRenderingItemTemplateSelector.GroupTemplate>
                        <DataTemplate>
                            <telerik:RadToggleButton x:Name="expandCollapseButton" Content="{Binding DisplayName}" Style="{Binding GroupContainerStyle}" IsChecked="{Binding IsExpanded, Mode=TwoWay}"/>
                        </DataTemplate>
                    </propertyGrid:FlatRenderingItemTemplateSelector.GroupTemplate>
                </propertyGrid:FlatRenderingItemTemplateSelector>
            </ItemsControl.ItemTemplateSelector>
        </ItemsControl>
    </DataTemplate>
    <propertyGrid:GroupingItemsSourceConverter x:Key="GroupingItemsSourceConverter"/>
    <DataTemplate x:Key="groupTemplate">
        <ItemsControl ItemsSource="{Binding ., Converter={StaticResource GroupingItemsSourceConverter}}" Style="{StaticResource ItemsControlStyle}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Border BorderThickness="0 1 0 0" BorderBrush="{telerik1:FluentResource ResourceKey=BasicSolidBrush}" Margin="0 -1 0 0">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <telerik:RadToggleButton x:Name="expandCollapseButton"
                                    Content="{Binding Key}"
                                    IsChecked="{Binding AutoExpandGroups, Mode=OneTime, RelativeSource={RelativeSource AncestorType=controls:RadPropertyGrid}}"
                                    Style="{StaticResource PropertyGridToggleButtonStyle}"/>
                            <ContentPresenter x:Name="PART_ContentPresenter"
                                    Content="{Binding Items}"
                                    Grid.Row="1"
                                    Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=expandCollapseButton}">
                                <ContentPresenter.ContentTemplate>
                                    <DataTemplate>
                                        <ItemsControl ItemsSource="{Binding Converter={StaticResource FlatItemSourceConverter}}" IsTabStop="False">
                                            <ItemsControl.ItemTemplate>
                                                <DataTemplate>
                                                    <propertyGrid:PropertyGridField Content="{Binding}" Visibility="{Binding Visibility}"/>
                                                </DataTemplate>
                                            </ItemsControl.ItemTemplate>
                                        </ItemsControl>
                                    </DataTemplate>
                                </ContentPresenter.ContentTemplate>
                            </ContentPresenter>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>
    <propertyGrid:ItemTemplateConverter x:Key="ItemTemplateConverter"
            FlatTemplate="{StaticResource flatTemplate}"
            GroupTemplate="{StaticResource groupTemplate}"
            VirtualizedFlatTemplate="{StaticResource virtualizedFlatTemplate}"
            FlatRenderingTemplate="{StaticResource flatRenderingTemplate}"/>
    <Style x:Key="PropertyGridGripperStyle" TargetType="Thumb">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Width" Value="8"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Border
                            Padding="{TemplateBinding Padding}"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="PropertyGridColumnResizerTemplate" TargetType="propertyGrid:PropertyGridColumnResizer">
        <Border VerticalAlignment="Stretch" Background="{TemplateBinding Background}">
            <Thumb HorizontalAlignment="Right" Style="{StaticResource PropertyGridGripperStyle}"/>
        </Border>
    </ControlTemplate>
    <Style x:Key="PropertyGridColumnResizerStyle" TargetType="propertyGrid:PropertyGridColumnResizer">
        <Setter Property="Template" Value="{StaticResource PropertyGridColumnResizerTemplate}"/>
        <Setter Property="IsTabStop" Value="False"/>
    </Style>
    <ControlTemplate x:Key="PropertyGridFieldTemplate" TargetType="propertyGrid:PropertyGridField">
        <Border x:Name="PART_RootElement" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid x:Name="PART_PropertyGridFieldGridN" Height="{TemplateBinding Height}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="{Binding LabelColumnWidth, ElementName=PropertyGridPresenter}"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Rectangle x:Name="Background_Over"
                            Grid.Column="1"
                            Grid.ColumnSpan="2"
                            Fill="{TemplateBinding mat:MaterialAssist.MouseOverBrush}"
                            HorizontalAlignment="Stretch"
                            Visibility="{Binding IsMouseOver, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"
                            VerticalAlignment="Stretch"/>
                    <Rectangle x:Name="PART_SelectionBackgroundN"
                            Grid.Column="1"
                            Grid.ColumnSpan="2"
                            Visibility="Collapsed"
                            HorizontalAlignment="Stretch"
                            Fill="{TemplateBinding mat:MaterialAssist.CheckedBrush}"
                            VerticalAlignment="Stretch"/>
                    <Grid x:Name="FieldIndicator" Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:RadPropertyGrid}}, Path=FieldIndicatorVisibility}">
                        <Border BorderThickness="0 0 1 0" BorderBrush="{TemplateBinding BorderBrush}" Width="31">
                            <telerik:RadGlyph x:Name="NavigatorIndicator"
                                    Foreground="{telerik1:FluentResource ResourceKey=IconBrush}"
                                    FontSize="16"
                                    Visibility="Collapsed"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Glyph="{StaticResource GlyphArrowChevronRight}"/>
                        </Border>
                    </Grid>
                    <Border Grid.Column="1" BorderThickness="0 0 0 1" BorderBrush="{TemplateBinding BorderBrush}">
                        <StackPanel Orientation="Horizontal">
                            <propertyGrid:PropertyGridIndentPresenter IndentLevel="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IndentLevel}">
                                <propertyGrid:PropertyGridIndentPresenter.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Orientation="Horizontal"/>
                                    </ItemsPanelTemplate>
                                </propertyGrid:PropertyGridIndentPresenter.ItemsPanel>
                                <propertyGrid:PropertyGridIndentPresenter.ItemTemplate>
                                    <DataTemplate>
                                        <propertyGrid:PropertyGridIndentCell/>
                                    </DataTemplate>
                                </propertyGrid:PropertyGridIndentPresenter.ItemTemplate>
                                <propertyGrid:PropertyGridIndentPresenter.Template>
                                    <ControlTemplate>
                                        <ItemsPresenter/>
                                    </ControlTemplate>
                                </propertyGrid:PropertyGridIndentPresenter.Template>
                            </propertyGrid:PropertyGridIndentPresenter>
                            <telerik:RadToggleButton x:Name="PART_NestedPropertiesButton"
                                    Style="{StaticResource PropertyGridNestedToggleButtonStyle}"
                                    Visibility="{Binding ShouldDisplayNestedProperties, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
                                    IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsExpanded, Mode=TwoWay}"/>
                            <TextBlock x:Name="PART_FieldLabelN" Text="{Binding DisplayName}" IsHitTestVisible="True" VerticalAlignment="Center" Margin="5 0"/>
                        </StackPanel>
                    </Border>
                    <Border x:Name="BorderVisual" Grid.Column="2" BorderThickness="1 0 0 1" BorderBrush="{TemplateBinding BorderBrush}"/>
                    <ContentControl x:Name="Content"
                            Content="{TemplateBinding Content}"
                            MinHeight="28"
                            Margin="2 1 2 2"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Grid.Column="2"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            IsTabStop="False"/>
                    <propertyGrid:PropertyGridColumnResizer x:Name="ColumnResizer" Grid.Column="1" Margin="0 0 -4 0" HorizontalAlignment="Right"/>
                </Grid>
                <ItemsControl Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}, Path=ShouldDisplayNestedItemsControl }" Grid.Row="1" ItemsSource="{Binding NestedProperties, Converter={StaticResource FlatItemSourceConverter}}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <propertyGrid:PropertyGridField Content="{Binding}" Visibility="{Binding Visibility}"/>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter TargetName="PART_SelectionBackgroundN" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsCurrent" Value="True">
                <Setter TargetName="NavigatorIndicator" Property="Visibility" Value="Visible"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="PropertyGridValidationTemplate">
        <Grid SnapsToDevicePixels="True" VerticalAlignment="Top">
            <AdornedElementPlaceholder x:Name="Holder"/>
            <Border BorderBrush="{telerik1:FluentResource ResourceKey=ValidationBrush}" BorderThickness="1" CornerRadius="{telerik1:FluentResource ResourceKey=CornerRadius}"/>
            <Path
                    Data="{StaticResource ArrowTopRight8x8}"
                    Fill="{telerik1:FluentResource ResourceKey=ValidationBrush}"
                    Width="8"
                    Height="8"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Top"
                    Margin="0 1 1 0"/>
            <ToolTipService.ToolTip>
                <ToolTip x:Name="PART_ToolTip"
                        DataContext="{Binding RelativeSource={RelativeSource Mode=Self}, Path=PlacementTarget.DataContext}"
                        Template="{StaticResource ErrorTooltipTemplate}"
                        Placement="Right"/>
            </ToolTipService.ToolTip>
        </Grid>
    </ControlTemplate>
    <Style x:Key="PropertyGridFieldStyle" TargetType="propertyGrid:PropertyGridField">
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik1:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="mat:MaterialAssist.CheckedBrush" Value="{telerik1:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="Template" Value="{StaticResource PropertyGridFieldTemplate}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="MinHeight" Value="31"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Style.Resources>
            <Style TargetType="TextBlock">
                <Style.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}">
                <Setter Property="Validation.ErrorTemplate" Value="{StaticResource PropertyGridValidationTemplate}"/>
            </Style>
        </Style.Resources>
    </Style>
    <propertyGrid:VisibilityToGridLenghtConverter x:Key="VisibilityToGridLenghtConverter"/>
    <ControlTemplate x:Key="RadPropertyGridTemplate" TargetType="controls:RadPropertyGrid">
        <Grid x:Name="PART_PropertyGridContainer">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="{Binding DescriptionPanelVisibility, Converter={StaticResource VisibilityToGridLenghtConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
            </Grid.RowDefinitions>
            <Border x:Name="PART_RootElement"
                    Background="{TemplateBinding Background}"
                    Grid.RowSpan="3"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"/>
            <Border x:Name="Header"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{telerik1:FluentResource ResourceKey=MainBrush}"
                    Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource HeaderVisibilityConverter}}"
                    Panel.ZIndex="100"
                    MinHeight="36">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <telerik:RadRadioButton x:Name="groupButton"
                            Visibility="{TemplateBinding SortAndGroupButtonsVisibility}"
                            IsChecked="{Binding Path=IsGrouped, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                            VerticalAlignment="Center"
                            Padding="0"
                            MinHeight="28"
                            MinWidth="28"
                            Margin="10 0 5 0">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="Categorize"/>
                        </ToolTipService.ToolTip>
                        <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphCategorize}"/>
                    </telerik:RadRadioButton>
                    <telerik:RadRadioButton x:Name="sortButton"
                            Content="A-Z"
                            Visibility="{TemplateBinding SortAndGroupButtonsVisibility}"
                            Grid.Column="1"
                            Padding="0"
                            VerticalAlignment="Center"
                            MinHeight="28"
                            MinWidth="28">
                        <ToolTipService.ToolTip>
                            <ToolTip telerik:LocalizationManager.ResourceKey="Alphabetical"/>
                        </ToolTipService.ToolTip>
                    </telerik:RadRadioButton>
                    <TextBox x:Name="searchAsYouTypeTextBox"
                            AutomationProperties.Name="search as you type textbox"
                            Visibility="{TemplateBinding SearchBoxVisibility}"
                            Grid.Column="2"
                            HorizontalAlignment="Stretch"
                            Margin="10 0 5 0"
                            Padding="5 5 25 5"
                            VerticalAlignment="Center"
                            Text="{Binding FilterText, ElementName=PropertyGridPresenter, Mode=TwoWay}"
                            telerik:TextBoxBehavior.SelectAllOnGotFocus="True"
                            telerik:TextBoxBehavior.UpdateTextOnEnter="True"
                            telerik:TextBoxBehavior.UpdateTextOnTextChanged="True"
                            MinHeight="28"/>
                    <Border Grid.Column="2" Width="18" HorizontalAlignment="Right" Visibility="{TemplateBinding SearchBoxVisibility}" Margin="0 0 10 0" VerticalAlignment="Center">
                        <telerik:RadGlyph
                                Foreground="{telerik1:FluentResource ResourceKey=IconBrush}"
                                x:Name="SearchIcon"
                                FontSize="16"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Margin="0 0 2 0"
                                Glyph="{StaticResource GlyphZoom}"/>
                    </Border>
                </Grid>
            </Border>
            <propertyGrid:PropertyGridPresenter x:Name="PropertyGridPresenter"
                    Grid.Row="1"
                    LabelColumnWidth="{Binding LabelColumnWidth, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                    PropertyDefinitions="{Binding PropertyDefinitions, RelativeSource={RelativeSource TemplatedParent}}"
                    SearchInNestedProperties="{Binding SearchInNestedProperties, RelativeSource={RelativeSource TemplatedParent}}"
                    ContentTemplate="{Binding Path=PropertyGridLayoutState, RelativeSource={RelativeSource Self}, Converter={StaticResource ItemTemplateConverter}}"
                    IsGrouped="{TemplateBinding IsGrouped}"
                    RenderMode="{TemplateBinding RenderMode}"/>
            <Border x:Name="DescriptionPanel"
                    Grid.Row="2"
                    MinHeight="88"
                    BorderThickness="0 1 0 0"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Visibility="{TemplateBinding DescriptionPanelVisibility}">
                <StackPanel x:Name="PART_DescriptionPanel" Orientation="Vertical">
                    <TextBlock x:Name="PART_DescriptionLabelTextBlock" Text="{Binding SelectedPropertyDefinition.DisplayName,ElementName=PropertyGridPresenter}" Margin="5" FontWeight="SemiBold"/>
                    <TextBlock x:Name="PART_DescriptionContentTextBlock"
                            Text="{Binding SelectedPropertyDefinition.Description,ElementName=PropertyGridPresenter}"
                            Margin="5 0 5 5"
                            TextWrapping="Wrap"/>
                </StackPanel>
            </Border>
            <GridSplitter x:Name="PART_DescriptionPanelSplitter"
                    Grid.Row="2"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Top"
                    Background="Transparent"
                    Visibility="{Binding CanUserResizeDescriptionPanel, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"
                    Height="3"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" SourceName="searchAsYouTypeTextBox" Value="True">
                <Setter Property="Foreground" TargetName="SearchIcon" Value="{telerik1:FluentResource ResourceKey=MarkerMouseOverBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="RadPropertyGridStyle" TargetType="controls:RadPropertyGrid">
        <Setter Property="Template" Value="{StaticResource RadPropertyGridTemplate}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="GroupStyle" Value="{StaticResource PropertyGridToggleButtonStyle}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Style.Resources>
            <Style TargetType="GridSplitter"/>
        </Style.Resources>
    </Style>
    <Style x:Key="PropertyGridIndentCellStyle" TargetType="propertyGrid:PropertyGridIndentCell">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Width" Value="31"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="propertyGrid:PropertyGridIndentCell">
                    <Border
                            Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Margin="{TemplateBinding Padding}"
                            BorderBrush="{TemplateBinding BorderBrush}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="controls:RadPropertyGrid" BasedOn="{StaticResource RadPropertyGridStyle}"/>
    <Style TargetType="propertyGrid:PropertyGridField" BasedOn="{StaticResource PropertyGridFieldStyle}"/>
    <Style TargetType="propertyGrid:PropertyGridIndentCell" BasedOn="{StaticResource PropertyGridIndentCellStyle}"/>
    <Style TargetType="propertyGrid:PropertyGridColumnResizer" BasedOn="{StaticResource PropertyGridColumnResizerStyle}"/>
    <Style TargetType="propertyGrid:DropDownEditor" BasedOn="{StaticResource DropDownEditorStyle}"/>
    <Style x:Key="CollectionEditorGripperStyle" TargetType="Thumb">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Width" Value="20"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Cursor" Value="SizeNWSE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Border
                            Padding="{TemplateBinding Padding}"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="CollectionEditor_Template" TargetType="propertyGrid:CollectionEditor">
        <Border x:Name="PART_RootBorder"
                Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=Height}"
                Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=Width}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                Background="{TemplateBinding Background}">
            <Grid Background="Transparent">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="3*"/>
                </Grid.ColumnDefinitions>
                <Border x:Name="Header"
                        MinHeight="36"
                        Grid.ColumnSpan="2"
                        Visibility="{Binding Header, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DescriptionVisibilityConverter}}"
                        Background="{telerik1:FluentResource ResourceKey=MainBrush}">
                    <ContentControl
                            Margin="{TemplateBinding Padding}"
                            Content="{TemplateBinding Header}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Border>
                <Grid Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Border Background="{telerik1:FluentResource ResourceKey=MainBrush}" MinHeight="36">
                        <Grid MaxHeight="36">
                            <TextBlock telerik:LocalizationManager.ResourceKey="CollectionEditorItems" VerticalAlignment="Center" Margin="{TemplateBinding Padding}"/>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                <telerik:RadButton x:Name="moveDownButton"
                                        IsEnabled="{TemplateBinding IsEnabled}"
                                        telerik:TouchManager.TouchMode="None"
                                        Command="{x:Static propertyGrid:CollectionEditorCommands.MoveCurrentToNext}"
                                        MinWidth="28"
                                        MinHeight="28"
                                        Margin="0 0 5 0"
                                        Padding="0"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center">
                                    <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowChevronDown}"/>
                                </telerik:RadButton>
                                <telerik:RadButton x:Name="moveUpButton"
                                        IsEnabled="{TemplateBinding IsEnabled}"
                                        telerik:TouchManager.TouchMode="None"
                                        Command="{x:Static propertyGrid:CollectionEditorCommands.MoveCurrentToPrevious}"
                                        MinWidth="28"
                                        MinHeight="28"
                                        Padding="0"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center">
                                    <telerik:RadGlyph FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Glyph="{StaticResource GlyphArrowChevronUp}"/>
                                </telerik:RadButton>
                            </StackPanel>
                        </Grid>
                    </Border>
                    <ListBox x:Name="PART_CollectionListBox"
                            Grid.Row="1"
                            ItemTemplate="{TemplateBinding ItemTemplate}"
                            IsEnabled="{TemplateBinding IsEnabled}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="1 0 0 0"
                            Background="{TemplateBinding Background}"
                            ItemsSource="{TemplateBinding CollectionView}"
                            SelectedItem="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=CurrentItem, Mode=TwoWay}"/>
                </Grid>
                <Grid Grid.Row="1" Grid.Column="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Border Background="{telerik1:FluentResource ResourceKey=MainBrush}" MinHeight="36" MaxHeight="36">
                        <TextBlock telerik:LocalizationManager.ResourceKey="CollectionEditorProperties" VerticalAlignment="Center" Margin="{TemplateBinding Padding}"/>
                    </Border>
                    <controls:RadPropertyGrid
                            Grid.Row="1"
                            BorderThickness="1 0"
                            IsReadOnly="{TemplateBinding IsReadOnly}"
                            IsEnabled="{TemplateBinding IsEnabled}"
                            Item="{TemplateBinding CurrentItem}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            LabelColumnWidth="100"
                            SortAndGroupButtonsVisibility="Collapsed"
                            SearchBoxVisibility="Collapsed"
                            DescriptionPanelVisibility="Collapsed"/>
                </Grid>
                <Border x:Name="FooterPanel_Background"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        Grid.Row="2"
                        BorderThickness="0"
                        Grid.ColumnSpan="2"
                        Background="{telerik1:FluentResource ResourceKey=MainBrush}">
                    <Grid>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 5">
                            <telerik:RadButton
                                    IsEnabled="{TemplateBinding IsEnabled}"
                                    telerik:TouchManager.TouchMode="None"
                                    MinWidth="65"
                                    telerik:LocalizationManager.ResourceKey="CollectionEditorAdd"
                                    Command="{x:Static propertyGrid:CollectionEditorCommands.AddNew}"
                                    Margin="10 0"/>
                            <telerik:RadButton
                                    IsEnabled="{TemplateBinding IsEnabled}"
                                    telerik:TouchManager.TouchMode="None"
                                    MinWidth="65"
                                    telerik:LocalizationManager.ResourceKey="CollectionEditorRemove"
                                    Command="{x:Static propertyGrid:CollectionEditorCommands.Delete}"/>
                        </StackPanel>
                        <Thumb x:Name="PART_ResizeThumb" Style="{StaticResource CollectionEditorGripperStyle}" Visibility="{TemplateBinding ResizeGripperVisibility}"/>
                    </Grid>
                </Border>
            </Grid>
        </Border>
    </ControlTemplate>
    <Style x:Key="CollectionEditorStyle" TargetType="propertyGrid:CollectionEditor">
        <Setter Property="Template" Value="{StaticResource CollectionEditor_Template}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="{telerik1:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="10 0"/>
        <Setter Property="Width" Value="580"/>
        <Setter Property="Height" Value="404"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="propertyGrid:CollectionEditor" BasedOn="{StaticResource CollectionEditorStyle}"/>
    <ControlTemplate x:Key="CollectionEditorPicker_Template" TargetType="propertyGrid:CollectionEditorPicker">
        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Border x:Name="TextBorder" Background="{telerik1:FluentResource ResourceKey=PrimaryBrush}">
                    <TextBlock x:Name="PART_CollectionEditorTextBlock"
                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Source}"
                            Foreground="{TemplateBinding Foreground}"
                            Opacity="{telerik1:FluentResource ResourceKey=InputOpacity}"
                            VerticalAlignment="Center"
                            Margin="{TemplateBinding Padding}"/>
                </Border>
                <telerik:RadDropDownButton x:Name="DropDownButton"
                        IsEnabled="{TemplateBinding IsEnabled}"
                        Grid.Column="1"
                        HorizontalContentAlignment="Left"
                        IsBackgroundVisible="False"
                        MinWidth="28"
                        Padding="0"
                        BorderThickness="0"
                        PopupPlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                    <telerik:RadDropDownButton.DropDownContent>
                        <propertyGrid:CollectionEditor x:Name="PART_CollectionEditor"
                                BorderThickness="0"
                                Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=Source}"
                                Header="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=Header}"
                                ResizeGripperVisibility="Visible"
                                IsReadOnly="{TemplateBinding IsReadOnly}"/>
                    </telerik:RadDropDownButton.DropDownContent>
                </telerik:RadDropDownButton>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger SourceName="TextBorder" Property="IsMouseOver" Value="True">
                <Setter Property="Background" TargetName="TextBorder" Value="{telerik1:FluentResource ResourceKey=PrimaryMouseOverBrush}"/>
                <Setter Property="Foreground" TargetName="PART_CollectionEditorTextBlock" Value="{telerik1:FluentResource ResourceKey=MarkerMouseOverBrush}"/>
                <Setter Property="Opacity" TargetName="PART_CollectionEditorTextBlock" Value="1"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CollectionEditorPickerStyle" TargetType="propertyGrid:CollectionEditorPicker">
        <Setter Property="Template" Value="{StaticResource CollectionEditorPicker_Template}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik1:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Foreground" Value="{telerik1:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{telerik1:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="MinHeight" Value="28"/>
        <Setter Property="Padding" Value="5 0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource StaticValidationTooltipTemplate}"/>
    </Style>
    <Style TargetType="propertyGrid:CollectionEditorPicker" BasedOn="{StaticResource CollectionEditorPickerStyle}"/>
    <ControlTemplate x:Key="FlagEnumEditorNonEditableTemplate" TargetType="propertyGrid:FlagEnumEditor">
        <telerik:RadDropDownButton x:Name="PART_EnumValuesDropDownButton"
                HorizontalAlignment="Stretch"
                HorizontalContentAlignment="Stretch"
                IsTabStop="False"
                ClickMode="Press"
                Padding="0"
                Focusable="False"
                TabIndex="1"
                VerticalAlignment="Stretch"
                VerticalContentAlignment="Center">
            <telerik:RadDropDownButton.DropDownContent>
                <ScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" Padding="0">
                    <ItemsControl ItemsSource="{Binding EnumItemsSource, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="0">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Value}" Margin="5" VerticalContentAlignment="Center"/>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>
            </telerik:RadDropDownButton.DropDownContent>
            <TextBlock x:Name="FlagEnumEditor_InputTextBlock" Margin="{TemplateBinding Padding}" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>
        </telerik:RadDropDownButton>
    </ControlTemplate>
    <Style x:Key="FlagEnumEditorStyle" TargetType="propertyGrid:FlagEnumEditor">
        <Setter Property="Template" Value="{StaticResource FlagEnumEditorNonEditableTemplate}"/>
        <Setter Property="MinHeight" Value="28"/>
        <Setter Property="Padding" Value="5 0"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource StaticValidationTooltipTemplate}"/>
    </Style>
    <Style TargetType="propertyGrid:FlagEnumEditor" BasedOn="{StaticResource FlagEnumEditorStyle}"/>
    <ControlTemplate x:Key="CardViewGroupItem_ToggleButtonTemplate" TargetType="telerik:RadToggleButton">
        <Grid Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid Background="Transparent" Width="25">
                <telerik:RadGlyph x:Name="ExpanderGlyph"
                        RenderTransformOrigin="0.5,0.5"
                        Foreground="{telerik:FluentResource ResourceKey=IconBrush}"
                        Glyph="{StaticResource GlyphArrowChevronDown}"
                        FontSize="16">
                    <telerik:RadGlyph.RenderTransform>
                        <RotateTransform Angle="0"/>
                    </telerik:RadGlyph.RenderTransform>
                </telerik:RadGlyph>
            </Grid>
            <ContentPresenter x:Name="Content"
                    Grid.Column="1"
                    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.Triggers>

            <!-- IsChecked animation -->
            <Trigger Property="IsChecked" Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" Storyboard.TargetName="ExpanderGlyph">
                                <EasingDoubleKeyFrame KeyTime="00:00:00.2" Value="180"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" Storyboard.TargetName="ExpanderGlyph">
                                <EasingDoubleKeyFrame KeyTime="00:00:00.2" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>
            </Trigger>

            <!-- CardViewGroupItem Focused state -->
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                <Setter TargetName="ExpanderGlyph" Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
            </DataTrigger>

            <!-- CardViewGroupItem IsMouseOver state -->
            <DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
                <Setter TargetName="ExpanderGlyph" Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardViewGroupItem_ToggleButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="Background" Value="{telerik:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource CardViewGroupItem_ToggleButtonTemplate}"/>
        <Style.Triggers>

            <!-- Rotate CardView when CardLayout is set to Columns -->
            <DataTrigger Binding="{Binding Path=CardLayout, RelativeSource={RelativeSource AncestorType={x:Type controls:RadCardView}, Mode=FindAncestor}}" Value="Columns">
                <Setter Property="LayoutTransform">
                    <Setter.Value>
                        <RotateTransform Angle="-90"/>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <ControlTemplate x:Key="RadCardViewGroupItemTemplate" TargetType="controls:RadCardViewGroupItem">
        <Grid>
            <Border x:Name="BackgroundVisual" Background="{TemplateBinding Background}"/>
            <Border x:Name="BorderBottomVisual"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                    BorderBrush="{TemplateBinding BorderBrush}"/>
            <telerik:RadToggleButton x:Name="PART_CardViewGroupItemToggleButton"
                    Content="{TemplateBinding Header}"
                    Foreground="{TemplateBinding Foreground}"
                    Style="{StaticResource CardViewGroupItem_ToggleButtonStyle}"
                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                    Padding="{TemplateBinding Padding}"
                    IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}"/>
        </Grid>
        <ControlTemplate.Triggers>

            <!-- IsMouseOver -->
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="BackgroundVisual" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush)}"/>
                <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
            </Trigger>

            <!-- Focused -->
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
                <Setter TargetName="BackgroundVisual" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.FocusBrush)}"/>
                <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=AccentBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- RadCardViewGroupItem Style -->
    <Style x:Key="RadCardViewGroupItemStyle" TargetType="controls:RadCardViewGroupItem">
        <Setter Property="mat:MaterialAssist.FocusBrush" Value="Transparent"/>
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="BorderThickness" Value="0 0 0 1"/>
        <Setter Property="Background" Value="{telerik:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="MinHeight" Value="31"/>
        <Setter Property="MinWidth" Value="31"/>
        <Setter Property="FontSize" Value="{telerik:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Padding" Value="5 0"/>
        <Setter Property="Margin" Value="1 0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource RadCardViewGroupItemTemplate}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=CardLayout, RelativeSource={RelativeSource AncestorType={x:Type controls:RadCardView}, Mode=FindAncestor}}" Value="Columns">
                <Setter Property="BorderThickness" Value="0 0 1 0"/>
                <Setter Property="Margin" Value="0"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="controls:RadCardViewGroupItem" BasedOn="{StaticResource RadCardViewGroupItemStyle}"/>
    <ControlTemplate x:Key="CardViewItemExpanderHeaderButtonTemplate" TargetType="telerik:RadToggleButton">
        <Border x:Name="BorderVisual" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
            <mat:FluentControl
                    IsRippleEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:FluentControl.IsRippleEnabled)}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    ClipToBounds="True">
                <telerik:RadGlyph x:Name="chevron"
                        Glyph="{StaticResource GlyphArrowChevronDown}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        FontSize="16"
                        Foreground="{TemplateBinding Foreground}"/>
            </mat:FluentControl>
        </Border>
        <ControlTemplate.Triggers>

            <!-- IsMouseOver -->
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="BorderVisual" Property="Background" Value="{telerik:FluentResource ResourceKey=AccentMouseOverBrush}"/>
            </Trigger>

            <!-- IsPressed -->
            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="BorderVisual" Property="Background" Value="{telerik:FluentResource ResourceKey=AccentPressedBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardViewItemExpanderHeaderButtonStyle" TargetType="telerik:RadToggleButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Width" Value="24"/>
        <Setter Property="Height" Value="24"/>
        <Setter Property="Margin" Value="0 0 7 0"/>
        <Setter Property="Template" Value="{StaticResource CardViewItemExpanderHeaderButtonTemplate}"/>
    </Style>
    <ControlTemplate x:Key="CardViewItemExpanderTemplate" TargetType="telerik:RadExpander">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition x:Name="row0" Height="Auto"/>
                <RowDefinition x:Name="row1" Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition x:Name="col0" Width="Auto"/>
                <ColumnDefinition x:Name="col1" Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border x:Name="BorderVisual"
                    Grid.Row="2"
                    Grid.ColumnSpan="2"
                    HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                    VerticalAlignment="{TemplateBinding VerticalAlignment}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{Binding RelativeSource={RelativeSource AncestorType={x:Type telerik:RadExpander}}, Path=BorderThickness, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=LeftRightBottom}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CornerRadius)}"/>
            <ContentPresenter x:Name="Content"
                    Margin="{TemplateBinding Padding}"
                    Visibility="Collapsed"
                    UseLayoutRounding="True"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            <telerikPrimitives:LayoutTransformControl x:Name="HeaderContentTransform" RenderTransformOrigin=".5 .5">
                <Border x:Name="HeaderPanel" MinHeight="36" Background="{telerik:FluentResource ResourceKey=AlternativeBrush}">
                    <Grid Background="Transparent" Margin="10 0 0 0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <ContentPresenter x:Name="HeaderContent"
                                Focusable="True"
                                TextElement.Foreground="{telerik:FluentResource ResourceKey=MarkerBrush}"
                                Content="{TemplateBinding Header}"
                                FocusVisualStyle="{x:Null}"
                                ContentTemplate="{TemplateBinding HeaderTemplate}"
                                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                                ContentStringFormat="{TemplateBinding HeaderStringFormat}"
                                VerticalAlignment="{TemplateBinding VerticalHeaderAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalHeaderAlignment}"/>
                        <telerik:RadToggleButton x:Name="HeaderButton"
                                Grid.Column="1"
                                IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                ClickMode="{TemplateBinding ClickMode}"
                                Content="{TemplateBinding Header}"
                                ContentTemplate="{TemplateBinding HeaderTemplate}"
                                Style="{TemplateBinding HeaderButtonStyle}"
                                ContentStringFormat="{TemplateBinding HeaderStringFormat}"
                                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"/>
                    </Grid>
                </Border>
            </telerikPrimitives:LayoutTransformControl>
            <Border x:Name="FocusVisual"
                    Grid.ColumnSpan="2"
                    Grid.RowSpan="2"
                    BorderBrush="{Binding RelativeSource={RelativeSource AncestorType={x:Type telerik:RadExpander}}, Path=(mat:MaterialAssist.FocusBrush)}"
                    BorderThickness="2"
                    Background="{x:Null}"
                    Opacity="0"
                    CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CornerRadius)}"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsExpanded" Value="False">
                <Setter Property="BorderThickness" Value="0"/>
            </Trigger>

            <!-- CardViewItem Focused -->
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
                <Setter TargetName="FocusVisual" Property="Opacity" Value="1"/>
            </Trigger>
            <DataTrigger Binding="{Binding IsFocused, RelativeSource={RelativeSource AncestorType={x:Type controls:RadCardViewItem}}}" Value="True">
                <Setter TargetName="FocusVisual" Property="Opacity" Value="1"/>
            </DataTrigger>

            <!-- CardViewItem Selected -->
            <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type controls:RadCardViewItem}}, Mode=TwoWay}" Value="True">
                <Setter TargetName="HeaderContent" Property="TextElement.Foreground" Value="{telerik:FluentResource ResourceKey=MarkerInvertedBrush}"/>
                <Setter TargetName="HeaderButton" Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerInvertedBrush}"/>
                <Setter TargetName="HeaderPanel" Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type telerik:RadExpander}}, Path=(mat:MaterialAssist.CheckedBrush)}"/>
                <Setter TargetName="HeaderPanel" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type telerik:RadExpander}}, Path=(mat:MaterialAssist.FocusBrush)}"/>
            </DataTrigger>
            <Trigger Property="ResultOrientation" Value="Vertical">
                <Setter TargetName="HeaderContentTransform" Property="LayoutTransform">
                    <Setter.Value>
                        <RotateTransform Angle="90"/>
                    </Setter.Value>
                </Setter>
                <Setter TargetName="HeaderContentTransform" Property="Grid.Row" Value="1"/>
            </Trigger>
            <Trigger Property="ResultOrientation" Value="Horizontal">
                <Setter TargetName="HeaderContentTransform" Property="LayoutTransform">
                    <Setter.Value>
                        <RotateTransform Angle="0"/>
                    </Setter.Value>
                </Setter>
                <Setter TargetName="HeaderContentTransform" Property="Grid.Column" Value="1"/>
            </Trigger>

            <!-- ExpandDirection: Down -->
            <Trigger Property="ExpandDirection" Value="Down">
                <Setter TargetName="col0" Property="Width" Value="*"/>
                <Setter TargetName="row1" Property="Height" Value="*"/>
                <Setter TargetName="Content" Property="Grid.Row" Value="1"/>
                <Setter TargetName="Content" Property="Grid.Column" Value="0"/>
                <Setter TargetName="HeaderContentTransform" Property="Grid.Row" Value="0"/>
                <Setter TargetName="HeaderContentTransform" Property="Grid.Column" Value="0"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardViewItemExpanderStyle" TargetType="telerik:RadExpander">
        <Setter Property="mat:MaterialAssist.FocusBrush" Value="{telerik:FluentResource ResourceKey=AccentFocusedBrush}"/>
        <Setter Property="mat:MaterialAssist.CheckedBrush" Value="{telerik:FluentResource ResourceKey=AccentBrush}"/>
        <Setter Property="mat:MaterialAssist.CornerRadius" Value="0"/>
        <Setter Property="RenderTransformOrigin" Value="0.5 0.5"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalHeaderAlignment" Value="Stretch"/>
        <Setter Property="VerticalHeaderAlignment" Value="Center"/>
        <Setter Property="telerik:AnimationManager.IsAnimationEnabled" Value="False"/>
        <Setter Property="Template" Value="{StaticResource CardViewItemExpanderTemplate}"/>
        <Setter Property="HeaderButtonStyle" Value="{StaticResource CardViewItemExpanderHeaderButtonStyle}"/>
        <Style.Triggers>

            <!-- Rotate CardViewItemExpander when it is not expanded and CardLayout is set to Rows -->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Path=IsExpanded, RelativeSource={RelativeSource Mode=Self}}" Value="False"/>
                    <Condition Binding="{Binding Path=CardLayout, RelativeSource={RelativeSource AncestorType={x:Type controls:RadCardView}, Mode=FindAncestor}}" Value="Rows"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="LayoutTransform">
                    <Setter.Value>
                        <RotateTransform Angle="-90"/>
                    </Setter.Value>
                </Setter>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>
    <ControlTemplate x:Key="CardViewGroupPanelTemplate" TargetType="grid:CardViewGroupPanel">
        <Border UseLayoutRounding="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <StackPanel Orientation="Horizontal">
                <TextBlock x:Name="panelText"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        Margin="{TemplateBinding Padding}"
                        FontSize="{TemplateBinding FontSize}"
                        telerik:LocalizationManager.ResourceKey="CardViewGroupPanelText"
                        IsHitTestVisible="False"/>
                <TextBlock x:Name="panelTextGrouped"
                        Margin="{TemplateBinding Padding}"
                        Visibility="Collapsed"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        telerik:LocalizationManager.ResourceKey="CardViewGroupPanelTopTextGrouped"
                        IsHitTestVisible="False"/>
                <ItemsPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </StackPanel>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="HasItems" Value="True">
                <Setter TargetName="panelText" Property="Visibility" Value="Collapsed"/>
                <Setter TargetName="panelTextGrouped" Property="Visibility" Value="Visible"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ItemsPanelTemplate x:Key="CardViewGroupPanelItemsPanelTemplate">
        <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch"/>
    </ItemsPanelTemplate>
    <Style x:Key="CardViewGroupPanelStyle" TargetType="grid:CardViewGroupPanel">
        <Setter Property="Template" Value="{StaticResource CardViewGroupPanelTemplate}"/>
        <Setter Property="ItemsPanel" Value="{StaticResource CardViewGroupPanelItemsPanelTemplate}"/>
        <Setter Property="MinHeight" Value="36"/>
        <Setter Property="Padding" Value="10 0 0 0"/>
        <Setter Property="Margin" Value="10 0"/>
        <Setter Property="FontSize" Value="{telerik:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style TargetType="grid:CardViewGroupPanel" BasedOn="{StaticResource CardViewGroupPanelStyle}"/>
    <ControlTemplate x:Key="CardViewGroupPanelCloseButtonTemplate" TargetType="Button">
        <Border x:Name="CloseButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <telerik:RadGlyph
                    FontSize="{TemplateBinding FontSize}"
                    Foreground="{TemplateBinding Foreground}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Glyph="{StaticResource GlyphClose}"/>
        </Border>
        <ControlTemplate.Triggers>

            <!-- IsMouseOver -->
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=IconBrush}"/>
            </Trigger>

            <!-- IsPressed -->
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=IconBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardViewGroupPaneCloseButtonStyle" TargetType="Button">
        <Setter Property="Template" Value="{StaticResource CardViewGroupPanelCloseButtonTemplate}"/>
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
    </Style>
    <ControlTemplate x:Key="CardViewGroupPanelCellTemplate" TargetType="grid:CardViewGroupPanelCell">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0:0:0.2" To="MouseOver"/>
                        <VisualTransition GeneratedDuration="0:0:0.2" To="Normal"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal"/>
                    <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>
                            <DoubleAnimationUsingKeyFrames
                                    BeginTime="0"
                                    Duration="0"
                                    Storyboard.TargetName="ContentElement"
                                    Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                                <EasingDoubleKeyFrame KeyTime="0" Value="-7"/>
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="0:001" Storyboard.TargetName="PART_CloseButton" Storyboard.TargetProperty="Opacity">
                                <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="OuterBorder"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CornerRadius)}"/>
            <Border x:Name="MouseOverVisual"
                    Visibility="Collapsed"
                    CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CornerRadius)}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.MouseOverBrush)}"
                    BorderBrush="{telerik:FluentResource ResourceKey=BasicBrush}"/>
            <Grid Background="Transparent">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid x:Name="SortIndicatorGrid" Background="#01FFFFFF" VerticalAlignment="Top" HorizontalAlignment="Center" Opacity="0" ColumnSpan="3" Column="0" Margin="0 -3 0 0">
                    <telerik:RadGlyph x:Name="PART_SortIndicator"
                            IsHitTestVisible="False"
                            Foreground="{telerik:FluentResource ResourceKey=IconBrush}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Glyph="{StaticResource GlyphArrowChevronDown}"
                            FontSize="16"/>
                </Grid>
                <ContentControl x:Name="ContentElement"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        Margin="{TemplateBinding Padding}"
                        Foreground="{TemplateBinding Foreground}"
                        IsTabStop="{TemplateBinding IsTabStop}"
                        Content="{TemplateBinding Content}"
                        Opacity="1">
                    <ContentControl.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleY="1" ScaleX="1"/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </ContentControl.RenderTransform>
                </ContentControl>
                <Button x:Name="PART_CloseButton"
                        AutomationProperties.Name="close button"
                        Foreground="{TemplateBinding Foreground}"
                        Style="{StaticResource CardViewGroupPaneCloseButtonStyle}"
                        Margin="5 0"
                        Grid.Column="2"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Center"
                        Opacity="0"/>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>

            <!-- IsMouseOver -->
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="PART_CloseButton" Property="Opacity" Value="1"/>
                <Setter TargetName="MouseOverVisual" Property="Visibility" Value="Visible"/>
            </Trigger>

            <!-- SortDirection: Ascending -->
            <DataTrigger Binding="{Binding Path=SortDirection}" Value="Ascending">
                <Setter Property="Opacity" TargetName="SortIndicatorGrid" Value="1"/>
                <Setter TargetName="PART_SortIndicator" Property="Glyph" Value="{StaticResource GlyphArrowChevronUp}"/>
            </DataTrigger>

            <!-- SortDirection: Descending -->
            <DataTrigger Binding="{Binding Path=SortDirection}" Value="Descending">
                <Setter Property="Opacity" TargetName="SortIndicatorGrid" Value="1"/>
            </DataTrigger>

            <!-- SortDirection: Null -->
            <DataTrigger Binding="{Binding Path=SortDirection}" Value="{x:Null}">
                <Setter Property="Opacity" TargetName="SortIndicatorGrid" Value="0"/>
            </DataTrigger>

            <!-- Disabled -->
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="ContentElement" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
                <Setter TargetName="PART_SortIndicator" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
                <Setter TargetName="PART_CloseButton" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardViewGroupPanelCellStyle" TargetType="grid:CardViewGroupPanelCell">
        <Setter Property="Template" Value="{StaticResource CardViewGroupPanelCellTemplate}"/>
        <Setter Property="mat:MaterialAssist.CornerRadius" Value="0"/>
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="mat:MaterialAssist.PressedBrush" Value="Transparent"/>
        <Setter Property="mat:MaterialAssist.DisabledBrush" Value="Transparent"/>
        <Setter Property="Background" Value="{telerik:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="MinHeight" Value="28"/>
        <Setter Property="MinWidth" Value="30"/>
        <Setter Property="Padding" Value="10 2 5 2"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="grid:CardViewGroupPanelCell" BasedOn="{StaticResource CardViewGroupPanelCellStyle}"/>
    <telerik:InvertedBooleanToOpacityConverter x:Key="InvertedBooleanToOpacityConverter"/>
    <ControlTemplate x:Key="CardViewGroupPanelItemTemplate" TargetType="grid:CardViewGroupPanelItem">
        <StackPanel x:Name="PART_GroupPanelItemStackPanel"
                Orientation="Horizontal"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                Background="{TemplateBinding Background}">
            <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                <telerik:RadGlyph x:Name="PART_InsertionPoint"
                        Glyph="{StaticResource GlyphArrow60Down}"
                        FontSize="16"
                        Margin="0 -4 0 0"
                        Foreground="{TemplateBinding Foreground}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Top"
                        Visibility="{TemplateBinding InsertionPointVisibility}"/>
                <telerik:RadGlyph x:Name="PART_ConnectingLine"
                        Opacity="{Binding IsFirst, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InvertedBooleanToOpacityConverter}}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="Center"
                        Glyph="{StaticResource GlyphArrowChevronRight}"
                        FontSize="16"
                        Foreground="{TemplateBinding Foreground}"
                        Margin="3 0"/>
            </Grid>
            <grid:CardViewGroupPanelCell Content="{TemplateBinding Content}" SortDirection="{Binding Path=SortDirection}" x:Name="PART_Cell"/>
            <telerik:RadGlyph x:Name="PART_RightInsertionPoint"
                    Glyph="{StaticResource GlyphArrow60Down}"
                    Foreground="{TemplateBinding Foreground}"
                    FontSize="16"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Top"
                    Margin="3 -4 3 0"
                    Visibility="{TemplateBinding RightInsertionPointVisibility}"/>
        </StackPanel>
    </ControlTemplate>
    <Style x:Key="CardViewGroupPanelItemStyle" TargetType="grid:CardViewGroupPanelItem">
        <Setter Property="Template" Value="{StaticResource CardViewGroupPanelItemTemplate}"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="4 0"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="grid:CardViewGroupPanelItem" BasedOn="{StaticResource CardViewGroupPanelItemStyle}"/>
    <ControlTemplate x:Key="CardDataFieldDescriptorHeaderCellButtonTemplate" TargetType="telerik:RadButton">
        <Grid Background="#01FFFFFF">
            <ContentPresenter x:Name="Content"
                    TextBlock.Foreground="{TemplateBinding Foreground}"
                    Margin="{TemplateBinding Padding}"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                    ContentStringFormat="{TemplateBinding ContentStringFormat}"
                    RecognizesAccessKey="True"/>
        </Grid>
    </ControlTemplate>
    <Style x:Key="CardDataFieldDescriptorHeaderCellButtonStyle" TargetType="telerik:RadButton">
        <Setter Property="Template" Value="{StaticResource CardDataFieldDescriptorHeaderCellButtonTemplate}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Margin" Value="0 0 4 0"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=IconBrush}"/>
        <Setter Property="Padding" Value="0"/>
    </Style>
    <Style x:Key="CardDataFieldStretchedContentControl" TargetType="ContentControl">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    </Style>
    <ControlTemplate x:Key="CardDataFieldDescriptorHeaderCellTemplate" TargetType="grid:CardDataFieldDescriptorHeaderCell">
        <Grid x:Name="PART_OuterGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="PART_HeaderCellGrid">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Border x:Name="BorderVisual"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                        Grid.ColumnSpan="3"/>
                <Border x:Name="MouseOverVisual" Grid.ColumnSpan="3" Background="{TemplateBinding mat:MaterialAssist.MouseOverBrush}" Opacity="0"/>
                <Border x:Name="SelectedVisual" Grid.ColumnSpan="3" Background="{TemplateBinding mat:MaterialAssist.CheckedBrush}" Opacity="0"/>
                <mat:FluentControl
                        Grid.ColumnSpan="3"
                        IsRippleEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:FluentControl.IsRippleEnabled)}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        HorizontalContentAlignment="Stretch"
                        VerticalContentAlignment="Stretch"
                        ClipToBounds="True"/>
                <ContentControl x:Name="ContentPresenter"
                        Grid.Column="0"
                        Content="{TemplateBinding Content}"
                        Foreground="{TemplateBinding Foreground}"
                        Style="{StaticResource CardDataFieldStretchedContentControl}"
                        Margin="{TemplateBinding Padding}"
                        IsTabStop="{TemplateBinding IsTabStop}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                <ContentControl x:Name="ContentControl"
                        Grid.Column="0"
                        FontSize="10"
                        Content="{Binding SortingIndex, Converter={StaticResource SortingIndexConverter},RelativeSource={RelativeSource TemplatedParent}}"
                        Visibility="{Binding SortingIndex, Converter={StaticResource SortingIndexToVisibilityConverter},RelativeSource={RelativeSource TemplatedParent}}"
                        IsTabStop="{TemplateBinding IsTabStop}"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Top"/>
                <grid:CardViewFilteringDropDown x:Name="PART_DistinctFilterControl" Grid.Column="2" Visibility="{TemplateBinding FilteringUIVisibility}" Margin="0 0 4 0"/>
                <telerik:RadButton x:Name="PART_SortButton"
                        Grid.Column="1"
                        VerticalAlignment="Center"
                        Opacity="0"
                        MinHeight="0"
                        Style="{StaticResource CardDataFieldDescriptorHeaderCellButtonStyle}"
                        IsBackgroundVisible="False"
                        Visibility="{Binding AllowSorting, Converter={StaticResource BooleanToVisibilityConverter}}"
                        telerik:TouchManager.TouchMode="None">
                    <telerik:RadGlyph x:Name="GlyphSorting" Glyph="{StaticResource GlyphSortDescSmall}" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </telerik:RadButton>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>

            <!-- IsFilteringAllowed: False -->
            <DataTrigger Binding="{Binding Path=IsFilteringAllowed, RelativeSource={RelativeSource AncestorType={x:Type controls:RadCardView}, Mode=FindAncestor}}" Value="False">
                <Setter TargetName="PART_DistinctFilterControl" Property="Visibility" Value="Collapsed"/>
            </DataTrigger>

            <!-- CanUserSortDescriptors: False -->
            <DataTrigger Binding="{Binding Path=CanUserSortDescriptors, RelativeSource={RelativeSource AncestorType={x:Type controls:RadCardView}, Mode=FindAncestor}}" Value="False">
                <Setter TargetName="PART_SortButton" Property="Visibility" Value="Collapsed"/>
            </DataTrigger>

            <!-- IsSortingButtonVisible: False -->
            <DataTrigger Binding="{Binding IsSortingButtonVisible, RelativeSource={RelativeSource Mode=Self}}" Value="False">
                <Setter TargetName="PART_SortButton" Property="Visibility" Value="Collapsed"/>
            </DataTrigger>

            <!-- IsMouseOver -->
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="MouseOverVisual" Property="Opacity" Value="1"/>
                <Setter TargetName="PART_SortButton" Property="Opacity" Value="1"/>
            </Trigger>

            <!-- SortingState: Ascending -->
            <Trigger Property="SortingState" Value="Ascending">
                <Setter TargetName="PART_SortButton" Property="Opacity" Value="1"/>
                <Setter TargetName="GlyphSorting" Property="Glyph" Value="{StaticResource GlyphSortAscSmall}"/>
                <Setter TargetName="SelectedVisual" Property="Opacity" Value="1"/>
                <Setter TargetName="GlyphSorting" Property="Foreground" Value="{telerik:FluentResource ResourceKey=AccentFocusedBrush}"/>
                <Setter TargetName="PART_DistinctFilterControl" Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerInvertedBrush}"/>
                <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerInvertedBrush}"/>
            </Trigger>

            <!-- SortingState: Descending -->
            <Trigger Property="SortingState" Value="Descending">
                <Setter TargetName="PART_SortButton" Property="Opacity" Value="1"/>
                <Setter TargetName="SelectedVisual" Property="Opacity" Value="1"/>
                <Setter TargetName="GlyphSorting" Property="Foreground" Value="{telerik:FluentResource ResourceKey=AccentFocusedBrush}"/>
                <Setter TargetName="PART_DistinctFilterControl" Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerInvertedBrush}"/>
                <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerInvertedBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardDataFieldDescriptorHeaderCellStyle" TargetType="grid:CardDataFieldDescriptorHeaderCell">
        <Setter Property="mat:MaterialAssist.CornerRadius" Value="0"/>
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="mat:MaterialAssist.CheckedBrush" Value="{telerik:FluentResource ResourceKey=AccentBrush}"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Template" Value="{StaticResource CardDataFieldDescriptorHeaderCellTemplate}"/>
    </Style>
    <Style TargetType="grid:CardDataFieldDescriptorHeaderCell" BasedOn="{StaticResource CardDataFieldDescriptorHeaderCellStyle}"/>
    <ControlTemplate x:Key="CardViewDistinctFilterControlTemplate" TargetType="grid:CardViewFilteringDropDown">
        <Grid>
            <Button x:Name="PART_DropDownButton" AutomationProperties.Name="FilterDropDownButton">
                <Button.Template>
                    <ControlTemplate TargetType="Button">
                        <ContentPresenter/>
                    </ControlTemplate>
                </Button.Template>
                <Grid Cursor="Hand" Background="Transparent">
                    <telerik:RadGlyph x:Name="FilterIcon" FontSize="16" Glyph="{StaticResource GlyphFilter}" Foreground="{TemplateBinding Foreground}"/>
                </Grid>
            </Button>
            <Popup x:Name="PART_DropDownPopup" StaysOpen="True" AllowsTransparency="True" PopupAnimation="Fade" mat:ThemeEffectsHelper.IsAcrylic="True"/>
        </Grid>
        <ControlTemplate.Triggers>

            <!-- FunnelFillVisibility -->
            <Trigger Property="FunnelFillVisibility" Value="Visible">
                <Setter TargetName="FilterIcon" Property="Foreground" Value="{telerik:FluentResource ResourceKey=AccentFocusedBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardViewFilteringDropDownStyle" TargetType="grid:CardViewFilteringDropDown">
        <Setter Property="Template" Value="{StaticResource CardViewDistinctFilterControlTemplate}"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=IconBrush}"/>
    </Style>
    <Style TargetType="grid:CardViewFilteringDropDown" BasedOn="{StaticResource CardViewFilteringDropDownStyle}"/>
    <sys:Double x:Key="FilteringControlComboBoxMinHeight">28</sys:Double>
    <Style x:Key="FilterDistinctValueListBoxItemStyle" TargetType="ListBoxItem">
        <Setter Property="Padding" Value="4"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <ContentPresenter x:Name="contentPresenter"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <DataTemplate x:Key="FilterActionTemplate">
        <TextBlock Text="{Binding Converter={StaticResource CardViewFilterOperatorConverter}}"/>
    </DataTemplate>
    <DataTemplate x:Key="FilterLogicalOperatorTemplate">
        <TextBlock Text="{Binding Converter={StaticResource FilterCompositionLogicalOperatorConverter}}"/>
    </DataTemplate>
    <ControlTemplate x:Key="CardViewFilteringControlTemplate" TargetType="grid:FilteringControl">
        <Grid Background="Transparent" Margin="5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Border
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    Margin="{TemplateBinding Margin}"
                    CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CornerRadius)}"
                    BorderBrush="{TemplateBinding BorderBrush}">
                <Grid>
                    <StackPanel Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                        <StackPanel x:Name="PART_DistinctFilter" Visibility="{TemplateBinding DistinctFiltersVisibility}">
                            <CheckBox x:Name="PART_SelectAllCheckBox"
                                    AutomationProperties.Name="select all checkbox"
                                    IsChecked="{Binding SelectAll, Mode=TwoWay}"
                                    Margin="0 5 0 0"
                                    telerik:LocalizationManager.ResourceKey="CardViewFilterSelectAll"/>
                            <ListBox x:Name="PART_DistinctValuesList"
                                    Padding="4"
                                    AutomationProperties.Name="distinct values list"
                                    Margin="0 5 0 0"
                                    ItemsSource="{Binding DistinctValues}"
                                    ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                    SelectionMode="Multiple"
                                    ItemContainerStyle="{StaticResource FilterDistinctValueListBoxItemStyle}">
                                <ListBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel MaxHeight="242"/>
                                    </ItemsPanelTemplate>
                                </ListBox.ItemsPanel>
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}" Content="{Binding ConvertedValue, Converter={StaticResource DistinctValueConverter}}" VerticalAlignment="Center"/>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </StackPanel>
                        <StackPanel Margin="0 2" Visibility="{TemplateBinding FieldFiltersVisibility}">
                            <TextBlock telerik:LocalizationManager.ResourceKey="CardViewFilterShowRowsWithValueThat" Margin="0 2 0 0"/>
                            <input:RadComboBox x:Name="PART_Filter1ComboBox"
                                    MinHeight="{StaticResource FilteringControlComboBoxMinHeight}"
                                    AutomationProperties.Name="first filter combobox"
                                    Margin="0 5 0 0"
                                    ItemTemplate="{StaticResource FilterActionTemplate}"
                                    ItemsSource="{Binding AvailableActions}"
                                    SelectedItem="{Binding Filter1.Operator, Mode=TwoWay}"/>
                            <ContentControl x:Name="PART_Filter1ContentControl"
                                    DataContext="{Binding Filter1}"
                                    Margin="0 5 0 0"
                                    IsEnabled="{Binding Operator, Converter={StaticResource FilterOperatorToFilterEditorIsEnabledConverter}}"
                                    HorizontalContentAlignment="Stretch"
                                    VerticalContentAlignment="Stretch"/>
                            <input:RadComboBox x:Name="PART_LogicalOperatorsComboBox"
                                    AutomationProperties.Name="logical operators combobox"
                                    Margin="0 5 0 0"
                                    ItemTemplate="{StaticResource FilterLogicalOperatorTemplate}"
                                    ItemsSource="{Binding LogicalOperators}"
                                    SelectedItem="{Binding FieldFilterLogicalOperator, Mode=TwoWay}"/>
                            <input:RadComboBox x:Name="PART_Filter2ComboBox"
                                    AutomationProperties.Name="second filter combobox"
                                    Margin="0 5 0 0"
                                    ItemTemplate="{StaticResource FilterActionTemplate}"
                                    ItemsSource="{Binding AvailableActions}"
                                    SelectedItem="{Binding Filter2.Operator, Mode=TwoWay}"/>
                            <ContentControl x:Name="PART_Filter2ContentControl"
                                    DataContext="{Binding Filter2}"
                                    Margin="0 5 0 0"
                                    IsEnabled="{Binding Operator, Converter={StaticResource FilterOperatorToFilterEditorIsEnabledConverter}}"
                                    HorizontalContentAlignment="Stretch"
                                    VerticalContentAlignment="Stretch"/>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Button x:Name="PART_ApplyFilterButton"
                                    Grid.Column="0"
                                    MinWidth="100"
                                    Margin="0 5 0 0"
                                    Visibility="{TemplateBinding FilterButtonVisibility}"
                                    telerik:LocalizationManager.ResourceKey="CardViewFilter"
                                    VerticalAlignment="Center"/>
                            <Button x:Name="PART_ClearFilterButton"
                                    Grid.Column="1"
                                    MinWidth="100"
                                    Margin="5 5 0 0"
                                    telerik:LocalizationManager.ResourceKey="CardViewClearFilter"
                                    VerticalAlignment="Center"/>
                        </Grid>
                    </StackPanel>
                    <telerik:RadButton x:Name="PART_FilterCloseButton"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Top"
                            Margin="{TemplateBinding Padding}"
                            BorderThickness="0"
                            Padding="0"
                            Height="16"
                            Width="16">
                        <telerik:RadGlyph x:Name="GlyphClose" Glyph="{StaticResource GlyphClose}" FontSize="16" Foreground="{telerik:FluentResource ResourceKey=IconBrush}"/>
                    </telerik:RadButton>
                </Grid>
            </Border>
        </Grid>
    </ControlTemplate>
    <Style x:Key="CardViewFilteringControlStyle" TargetType="grid:FilteringControl">
        <Setter Property="mat:MaterialAssist.ShadowDepth" Value="Depth1"/>
        <Setter Property="Template" Value="{StaticResource CardViewFilteringControlTemplate}"/>
        <Setter Property="Background" Value="{Binding Source={StaticResource PrimaryBackgroundBrushProxy}, Path=ProxyValue, Converter={StaticResource OpacityConverter}, ConverterParameter=128, Mode=OneWay}"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="Padding" Value="10 5 10 10"/>
        <Setter Property="MinWidth" Value="250"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="grid:FilteringControl" BasedOn="{StaticResource CardViewFilteringControlStyle}"/>
    <ControlTemplate x:Key="CardViewPanelItemDropDownButtonTemplate" TargetType="telerik:RadDropDownButton">
        <Grid SnapsToDevicePixels="True">
            <Border x:Name="BorderVisual"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="{TemplateBinding CornerRadius}"/>
            <Border x:Name="FocusVisual"
                    Opacity="0"
                    BorderThickness="1"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    BorderBrush="{telerik:FluentResource ResourceKey=AccentFocusedBrush}"/>
            <mat:FluentControl
                    IsSmartClipped="True"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    HorizontalContentAlignment="Stretch"
                    VerticalAlignment="Stretch">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <ContentPresenter x:Name="Content"
                            Grid.Row="1"
                            Grid.Column="1"
                            TextBlock.Foreground="{TemplateBinding Foreground}"
                            Margin="{TemplateBinding Padding}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            RecognizesAccessKey="True"/>
                    <Grid x:Name="DropDownIndicator"
                            Grid.Column="1"
                            MinWidth="22"
                            Grid.Row="1"
                            Canvas.ZIndex="2"
                            HorizontalAlignment="Right"
                            IsHitTestVisible="False"
                            Visibility="{TemplateBinding DropDownIndicatorVisibility}">
                        <telerik:RadGlyph x:Name="ArrowGlyph" FontSize="12" Foreground="{TemplateBinding Foreground}" Glyph="{StaticResource GlyphArrowChevronDown}"/>
                    </Grid>
                </Grid>
            </mat:FluentControl>
            <Popup x:Name="DropDownPopup"
                    AllowsTransparency="True"
                    StaysOpen="False"
                    Focusable="False"
                    Placement="Bottom"
                    PopupAnimation="{TemplateBinding PopupAnimation}"
                    HorizontalOffset="0"
                    VerticalOffset="0">
                <Grid x:Name="PopupGrid" Margin="3 0 3 3">
                    <mat:Shadow x:Name="PopupShadow"
                            ShadowDepth="{TemplateBinding mat:MaterialAssist.ShadowDepth}"
                            SnapsToDevicePixels="True"
                            BorderBrush="Transparent"
                            BorderThickness="0"
                            Background="{telerik:FluentResource ResourceKey=AlternativeBrush}"
                            CornerRadius="{telerik:FluentResource ResourceKey=CornerRadiusBottom}"/>
                    <Border x:Name="DropDownPopupBorder"
                            Background="{telerik:FluentResource ResourceKey=PrimaryBackgroundBrush}"
                            BorderThickness="0"
                            Visibility="{Binding DropDownContent,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource NullToVisibilityConverter}}"
                            CornerRadius="{TemplateBinding CornerRadius}"
                            Width="{TemplateBinding DropDownWidth}"
                            Height="{TemplateBinding DropDownHeight}"
                            MinWidth="{TemplateBinding DropDownMinWidth}"
                            MinHeight="{TemplateBinding DropDownMinHeight}"
                            MaxWidth="{TemplateBinding DropDownMaxWidth}"
                            MaxHeight="{TemplateBinding DropDownMaxHeight}"
                            SnapsToDevicePixels="True">
                        <ContentControl x:Name="DropDownPopupContent"
                                Content="{TemplateBinding DropDownContent}"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch"
                                ContentTemplate="{TemplateBinding DropDownContentTemplate}"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext}"/>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
        <ControlTemplate.Triggers>

            <!-- General IsKeyboardFocused setters -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsEnabled" Value="True"/>
                    <Condition Property="IsKeyboardFocused" Value="True"/>
                </MultiTrigger.Conditions>
                <Setter TargetName="FocusVisual" Property="Opacity" Value="1"/>
            </MultiTrigger>

            <!-- General setters for IsMouseOver -->
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
                <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
            </Trigger>

            <!-- General setters for IsPressed -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsOpen" Value="False"/>
                    <Condition Property="IsPressed" Value="True"/>
                </MultiTrigger.Conditions>
                <Setter Property="Background" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
                <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
            </MultiTrigger>

            <!-- General setters for IsOpen -->
            <Trigger Property="IsOpen" Value="True">
                <Setter Property="Background" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
                <Setter Property="BorderBrush" TargetName="BorderVisual" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mat:MaterialAssist.CheckedBrush), Mode=OneWay}"/>
            </Trigger>

            <!-- disabled -->
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="Content" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
                <Setter TargetName="DropDownIndicator" Property="Opacity" Value="{telerik:FluentResource ResourceKey=DisabledOpacity}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="CardViewPanelItemDropDownButtonStyle" TargetType="telerik:RadDropDownButton">
        <Setter Property="mat:MaterialAssist.MouseOverBrush" Value="{telerik:FluentResource ResourceKey=MouseOverBrush}"/>
        <Setter Property="mat:MaterialAssist.PressedBrush" Value="{telerik:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="mat:MaterialAssist.FocusBrush" Value="{telerik:FluentResource ResourceKey=AccentFocusedBrush}"/>
        <Setter Property="mat:MaterialAssist.CheckedBrush" Value="{telerik:FluentResource ResourceKey=PressedBrush}"/>
        <Setter Property="mat:MaterialAssist.ShadowDepth" Value="Depth1"/>
        <Setter Property="IsOpen" Value="False"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="Background" Value="{telerik:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="DropDownMinHeight" Value="50"/>
        <Setter Property="DropDownMinWidth" Value="200"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="DropDownIndicatorVisibility" Value="Visible"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="6 2"/>
        <Setter Property="MinWidth" Value="68"/>
        <Setter Property="MinHeight" Value="28"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FlowDirection" Value="LeftToRight"/>
        <Setter Property="DropDownButtonPosition" Value="Left"/>
        <Setter Property="Template" Value="{StaticResource CardViewPanelItemDropDownButtonTemplate}"/>
    </Style>
    <ControlTemplate x:Key="RadCardViewItemTemplate" TargetType="controls:RadCardViewItem">
        <telerik:RadExpander
                Header="{TemplateBinding Header}"
                FontSize="{TemplateBinding FontSize}"
                FontFamily="{TemplateBinding FontFamily}"
                BorderBrush="{TemplateBinding BorderBrush}"
                Background="{TemplateBinding Background}"
                BorderThickness="{TemplateBinding BorderThickness}"
                HeaderTemplate="{TemplateBinding HeaderTemplate}"
                Style="{StaticResource CardViewItemExpanderStyle}"
                IsExpanded="{Binding IsExpanded, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}">
            <grid:CardViewDataForm x:Name="PART_CardViewDataForm" BorderThickness="0" CurrentItem="{Binding Data}"/>
        </telerik:RadExpander>
    </ControlTemplate>

    <!-- RadCardViewItem Style -->
    <Style x:Key="RadCardViewItemStyle" TargetType="controls:RadCardViewItem">
        <Setter Property="Background" Value="{telerik:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicBrush}"/>
        <Setter Property="Foreground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="BorderThickness" Value="1 0 1 1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Margin" Value="5"/>
        <Setter Property="FontFamily" Value="{telerik:FluentResource ResourceKey=FontFamily}"/>
        <Setter Property="FontSize" Value="{telerik:FluentResource ResourceKey=FontSize}"/>
        <Setter Property="Template" Value="{StaticResource RadCardViewItemTemplate}"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    </Style>
    <Style x:Key="CardDataFieldDescriptors_ListBoxItemStyle" TargetType="telerik:RadListBoxItem">
        <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadListBoxItem">
                    <grid:CardDataFieldDescriptorHeaderCell Content="{Binding Converter={StaticResource CardDataFieldDescriptorHeaderConverter}}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ItemsPanelTemplate x:Key="CardDataFieldDescriptors_ItemsPanel">
        <StackPanel/>
    </ItemsPanelTemplate>
    <ControlTemplate x:Key="RadCardViewTemplate" TargetType="controls:RadCardView">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="GroupPanel" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Border x:Name="GroupPanelBorderVisual"
                        Grid.ColumnSpan="2"
                        MinHeight="36"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Background="{TemplateBinding GroupPanelBackground}"/>
                <grid:CardViewGroupPanel x:Name="PART_GroupPanel" Visibility="{Binding ShowGroupPanel, RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource BooleanToVisibilityConverter}}" Foreground="{TemplateBinding GroupPanelForeground}"/>
                <telerik:RadDropDownButton x:Name="PART_DataFieldDescriptorsButton"
                        Grid.Column="1"
                        Margin="{Binding Margin, ElementName=PART_GroupPanel, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=Right}"
                        Style="{StaticResource CardViewPanelItemDropDownButtonStyle}"
                        IsTabStop="False"
                        Visibility="{Binding DataFieldDescriptorsButtonVisibility, RelativeSource={RelativeSource TemplatedParent}}">
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Right" telerik:LocalizationManager.ResourceKey="CardViewDataFieldDescriptorsButtonTooltip"/>
                    </ToolTipService.ToolTip>
                    <telerik:RadDropDownButton.Content>
                        <telerik:RadGlyph
                                Glyph="{StaticResource GlyphGridLayout}"
                                FontSize="16"
                                Foreground="{Binding Foreground, ElementName=PART_DataFieldDescriptorsButton}"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Left"/>
                    </telerik:RadDropDownButton.Content>
                    <telerik:RadDropDownButton.DropDownContent>
                        <telerik:RadListBox
                                ItemsSource="{Binding DataFieldDescriptors}"
                                ItemContainerStyle="{StaticResource CardDataFieldDescriptors_ListBoxItemStyle}"
                                ItemsPanel="{StaticResource CardDataFieldDescriptors_ItemsPanel}"
                                BorderThickness="0"
                                Padding="0"
                                MaxWidth="200"
                                MaxHeight="250"/>
                    </telerik:RadDropDownButton.DropDownContent>
                </telerik:RadDropDownButton>
            </Grid>
            <Rectangle x:Name="BackgroundVisual" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="2" Fill="{TemplateBinding Background}"/>
            <layouts:LayoutPresenter x:Name="PART_LayoutPresenter" Grid.Row="1" Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=TopBottom}"/>
            <Border x:Name="BorderVisual"
                    Grid.ColumnSpan="2"
                    Grid.Row="1"
                    Grid.RowSpan="2"
                    Background="{x:Null}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=LeftRightBottom}"/>
            <ScrollBar x:Name="PART_VerticalScrollBar" Margin="0 0 1 1" Orientation="Vertical" Grid.Row="1" Grid.Column="1"/>
            <ScrollBar x:Name="PART_HorizontalScrollBar" Margin="1 0 1 1" Orientation="Horizontal" Grid.Row="2"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="CardLayout" Value="Columns">
                <Setter TargetName="PART_LayoutPresenter" Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={StaticResource ThicknessToOrientedThicknessConverter}, ConverterParameter=LeftRight}"/>
            </Trigger>
            <Trigger SourceName="PART_GroupPanel" Property="HasItems" Value="False">
                <Setter TargetName="PART_LayoutPresenter" Property="Margin" Value="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}}"/>
            </Trigger>

            <!-- Setters for hide GroupPanel -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="DataFieldDescriptorsButtonVisibility" Value="Collapsed"/>
                    <Condition Property="ShowGroupPanel" Value="False"/>
                </MultiTrigger.Conditions>
                <Setter TargetName="GroupPanel" Property="Visibility" Value="Collapsed"/>
                <Setter TargetName="BorderVisual" Property="BorderThickness" Value="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"/>
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- RadCardView Style -->
    <Style x:Key="RadCardViewStyle" TargetType="controls:RadCardView">
        <Setter Property="Template" Value="{StaticResource RadCardViewTemplate}"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Background" Value="{telerik:FluentResource ResourceKey=PrimaryBackgroundBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{telerik:FluentResource ResourceKey=BasicSolidBrush}"/>
        <Setter Property="GroupPanelBackground" Value="{telerik:FluentResource ResourceKey=MainBrush}"/>
        <Setter Property="GroupPanelForeground" Value="{telerik:FluentResource ResourceKey=MarkerBrush}"/>
        <Setter Property="CollapsedLength" Value="46"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="MajorLength" Value="300"/>
        <Setter Property="MinorLength" Value="270"/>
        <Style.Triggers>

            <!-- Swap MajorLength/MinorLength values when CardLayout is set to Columns -->
            <Trigger Property="CardLayout" Value="Columns">
                <Setter Property="MajorLength" Value="270"/>
                <Setter Property="MinorLength" Value="300"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="CardViewDataFormStyle" TargetType="grid:CardViewDataForm" BasedOn="{StaticResource RadDataFormStyle}">
        <Setter Property="Padding" Value="5 0"/>
    </Style>
    <Style TargetType="controls:RadCardView" BasedOn="{StaticResource RadCardViewStyle}"/>
    <Style TargetType="controls:RadCardViewItem" BasedOn="{StaticResource RadCardViewItemStyle}"/>
    <Style TargetType="grid:CardViewDataFormDataField" BasedOn="{StaticResource DataFormDataFieldStyle}"/>
    <Style TargetType="grid:CardViewDataForm" BasedOn="{StaticResource CardViewDataFormStyle}"/>
</ResourceDictionary>
