Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3914
generic styel for PicvotGrid
posted

Hi,

I use the Generic.xaml from the infragistics installation directory.

I get compilation errors at the following lines

xmlns:igPivot="clr-namespace:Infragistics.Controls.Grids"

xmlns:igPivotPrim="clr-namespace:Infragistics.Controls.Grids.Primitives"

I modified these as follows, but it seems to give other compilation errors.

xmlns:igPivot="http://schemas.infragistics.com/xaml"
xmlns:igPivotPrim="http://schemas.infragistics.com/xaml/primitives"

The below is the generic.xaml I use - it is from SR2094:

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ig="http://schemas.infragistics.com/xaml"
    xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives"
    xmlns:igPivot="clr-namespace:Infragistics.Controls.Grids"
    xmlns:igPivotPrim="clr-namespace:Infragistics.Controls.Grids.Primitives"
    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <!-- ************************************************ BRUSHES ************************************************
***********************************************************************************************************-->

    <LinearGradientBrush x:Key="DarkGradientBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FF617583" Offset="1"/>
        <GradientStop Color="#FF98B3C8"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="LightGradientBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FFffffff"/>
        <GradientStop Offset="1" Color="#FFccd3d8"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ExpanderBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FF617583"/>
        <GradientStop Offset="1" Color="#FF75889a"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ExpanderButtonBackgroundBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientStop Offset="0" Color="#FFffffff"/>
        <GradientStop Offset="1" Color="#FFccd3d8"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="InnerShdwBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#4c000000"/>
        <GradientStop Offset="1" Color="#00000000"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="UpdateButtonHoverBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FF718496"/>
        <GradientStop Offset="1" Color="#FF2E363F"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="UpdateButtonPressedBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFa3aeb9" Offset="1"/>
        <GradientStop Color="#FF8399a9" Offset="0.664"/>
        <GradientStop Color="#FF718597" Offset="0.38"/>
        <GradientStop Color="#FF617583"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="UpdateButtonStroke" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FF627684"/>
        <GradientStop Offset="1" Color="#FF617583"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="ArrowStroke" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF566370" Offset="0.003"/>
        <GradientStop Color="#FF6D7C8A" Offset="1"/>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="CubeDropdownSeparatorDarkBrush" Color="#FFCED5D9"/>
    <SolidColorBrush x:Key="CubeDropdownSeparatorLightBrush" Color="#FFFFFFFF"/>

    <SolidColorBrush x:Key="GridBackgroundBrush" Color="#FFFFFFFF"/>
    <LinearGradientBrush x:Key="GridBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FF93A8BC" Offset="0"/>
        <GradientStop Color="#FF8399a9" Offset="0.37"/>
        <GradientStop Color="#FF718597" Offset="0.652"/>
        <GradientStop Color="#FF617583" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="GridBorderBrush2" Color="#FF9F9F9F"/>

    <LinearGradientBrush x:Key="HeaderNormalBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFFFFFFF" Offset="0"/>
        <GradientStop Color="#FFeff1f2" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HeaderHoverBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFfefefe" Offset="0"/>
        <GradientStop Color="#FFf4f9fc" Offset="0.35"/>
        <GradientStop Color="#FFa9cae6" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="HeaderNormalBorderBrush" Color="#FFC9CACA"/>
    <SolidColorBrush x:Key="FooterBackgroundBrush" Color="#FFEDF0F3"/>
    <SolidColorBrush x:Key="CellItemNormalBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="CellItemNormalBorderBrush" Color="#FFC9CACA"/>
    <SolidColorBrush x:Key="CellItemAltNormalBackgroundBrush" Color="#FFF6F9FC"/>
    <SolidColorBrush x:Key="CellItemSelectedBackgroundBrush" Color="#FFD5EAF2"/>
    <SolidColorBrush x:Key="CellItemSelectedBorderBrush" Color="#FF6DBDD1"/>
    <SolidColorBrush x:Key="CellRowHoverBackgroundBrush" Color="#FFE6EFF7"/>
    <SolidColorBrush x:Key="AddNewRowBackgroundBrush" Color="#FFF6F7F8"/>
    <SolidColorBrush x:Key="CellRowActiveBackgroundBrush" Color="#FFBADDE9"/>
    <SolidColorBrush x:Key="RowSelectorBackgroundBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="RowSelectorBorderBrush" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="ExpansionCellBackgroundBrush" Color="#FFEDF0F3"/>
    <LinearGradientBrush x:Key="ExpansionIndicatorForegroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FF7cd7f2" Offset="0"/>
        <GradientStop Color="#FF69bcd5" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="MoveIndicatorBrush" Color="#FF6DBDD1"/>
    <SolidColorBrush x:Key="ResizeIndicatorBrush" Color="#59000000"/>

    <!-- Brushes used for FixedColumn Features -->
    <SolidColorBrush x:Key="FixedBorderFillBrush" Color="#FF8399A9"/>

    <!-- Brushes used for Pager -->
    <SolidColorBrush x:Key="PagerAreaBackground" Color="#FFEDEFF0"/>
    <LinearGradientBrush x:Key="PagerItemSelectedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFa3aeb9" Offset="0"/>
        <GradientStop Color="#FF8399a9" Offset="0.37"/>
        <GradientStop Color="#FF718597" Offset="0.66"/>
        <GradientStop Color="#FF617583" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="PagerGlyphBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFa3aeb9" Offset="0"/>
        <GradientStop Color="#FF8399a9" Offset="0.37"/>
        <GradientStop Color="#FF718597" Offset="0.636"/>
        <GradientStop Color="#FF617583" Offset="1"/>
    </LinearGradientBrush>

    <!-- Brushes used for GroupBy -->
    <LinearGradientBrush x:Key="GroupByHighlightBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#59FFFFFF" Offset="0"/>
        <GradientStop Color="#33FFFFFF" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GroupByBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFEEE9DD" Offset="0"/>
        <GradientStop Color="#FFEEE9DD" Offset="1"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="closeBtnHover" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FF70818D"/>
        <GradientStop Offset="1" Color="#FF485762"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="closeBtnPressed" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FF718496"/>
        <GradientStop Offset="1" Color="#FF2E363F"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GroupByColumnLayoutHeaderFill" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#FFbbe0ea"/>
        <GradientStop Offset="1" Color="#FF6dbdd1"/>
    </LinearGradientBrush>

    <!-- Brushes used for Text foregrounds -->
    <SolidColorBrush x:Key="SortToggleBorderBrush" Color="#FF6DBDD1"/>
    <SolidColorBrush x:Key="HeaderNormalForegroundBrush" Color="#FF444444"/>
    <SolidColorBrush x:Key="HeaderHoverForegroundBrush" Color="#FF444444"/>
    <SolidColorBrush x:Key="CellItemNormalForegroundBrush" Color="#FF444444"/>
    <SolidColorBrush x:Key="CellItemHoverForegroundBrush" Color="#FF444444"/>
    <SolidColorBrush x:Key="CellItemSelectedForegroundBrush" Color="#FF444444"/>

    <!-- Brushes used for Pin and Sort Indicators -->
    <LinearGradientBrush x:Key="HeaderCellGlyphBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFa3aeb9" Offset="0"/>
        <GradientStop Color="#FF8399a9" Offset="0.37"/>
        <GradientStop Color="#FF718597" Offset="0.644"/>
        <GradientStop Color="#FF617583" Offset="1"/>
    </LinearGradientBrush>

    <!-- PART_Popup Background -->
    <LinearGradientBrush x:Key="PopupBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFFFFFFF" Offset="0"/>
        <GradientStop Color="#FFFEFEFE" Offset="1"/>
    </LinearGradientBrush>

    <!-- FilterOperators -->
    <LinearGradientBrush x:Key="FilterOperatorGlyphBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFa3aeb9" Offset="0"/>
        <GradientStop Color="#FF8399a9" Offset="0.37"/>
        <GradientStop Color="#FF718597" Offset="0.604"/>
        <GradientStop Color="#FF617583" Offset="1"/>
    </LinearGradientBrush>

    <!-- Silverlight brushes -->
    <SolidColorBrush x:Key="FocusBrush" Color="#FF6DBDD1"/>
    <SolidColorBrush x:Key="DropIndicatorFill" Color="#FF6DBDD1"/>

    <SolidColorBrush x:Key="ItemHottrackCenterFill" Color="#FFDCEDF3"/>
    <SolidColorBrush x:Key="ItemHottrackOuterBorderFill" Color="#FFB5DDE7"/>
    <SolidColorBrush x:Key="ItemSelectedCenterFill" Color="#FFCAE4ED"/>
    <SolidColorBrush x:Key="ItemSelectedOuterBorderFill" Color="#FF90CCDB"/>

    <!-- ******************************************** END BRUSHES *********************************************
***********************************************************************************************************-->

    <!--FilterDropdownToggle-->
    <Style x:Key="FilterDropdownToggle" TargetType="ToggleButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked"/>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="#00000000"/>
                        <ContentPresenter x:Name="contentPresenter"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            Margin="{TemplateBinding Padding}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--FilterCellSortBtn-->
    <Style x:Key="FilterCellSortBtn" TargetType="CheckBox">
        <Setter Property="Width" Value="14"/>
        <Setter Property="Height" Value="14"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SortedDescending" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SortedAscending" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Indeterminate"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="Pressed"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid  VerticalAlignment="Center" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
                            <Border BorderBrush="{StaticResource HeaderCellGlyphBrush}" CornerRadius="1" BorderThickness="1" Margin="1" >
                                <Grid>
                                    <Rectangle Fill="{StaticResource HeaderCellGlyphBrush}" VerticalAlignment="Center" Height="1" Width="2"/>
                                    <Path IsHitTestVisible="False" Visibility="Collapsed" x:Name="SortedDescending" HorizontalAlignment="Center"
                                    VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" Fill="{StaticResource HeaderCellGlyphBrush}"/>
                                    <Path IsHitTestVisible="False" Visibility="Collapsed" x:Name="SortedAscending" HorizontalAlignment="Center"
                                    VerticalAlignment="Center" Data="M0,4 L8,4 L4,0 z" Fill="{StaticResource HeaderCellGlyphBrush}"/>
                                </Grid>
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--HeaderCellSortBtn-->
    <Style x:Key="HeaderCellSortBtn" TargetType="ToggleButton">
        <Setter Property="Width" Value="15"/>
        <Setter Property="Height" Value="14"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked"/>
                                <VisualState x:Name="Unchecked"/>
                                <VisualState x:Name="Indeterminate"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid VerticalAlignment="Center" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
                            <Border BorderBrush="{StaticResource HeaderCellGlyphBrush}" CornerRadius="1" BorderThickness="1" Margin="1" >
                                <StackPanel Orientation="Horizontal">
                                    <Path IsHitTestVisible="False" x:Name="SortedAscending1" HorizontalAlignment="Right" Margin="1,0,1,0" VerticalAlignment="Center"
                                    Data="M0,4 L4,8 L4,0 z" Fill="{StaticResource HeaderCellGlyphBrush}" />
                                    <Path IsHitTestVisible="False" x:Name="SortedDescending1" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Center"
                                    Data="M 0 0 L 4 4 L 0 8 Z" Fill="{StaticResource HeaderCellGlyphBrush}" />
                                </StackPanel>
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- HeaderCellControlExpansionIndicatorStyle -->
    <Style x:Key="HeaderCellControlExpansionIndicatorStyle" TargetType="ToggleButton">
        <Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="{StaticResource DarkGradientBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource DarkGradientBrush}"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Width="9" Height="9" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetName="ExpandGlyph" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FocusBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetName="CollapseGlyph" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FocusBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetName="BdForeground" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource FocusBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CollapseGlyph" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandGlyph" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="BdBackground" BorderBrush="White" CornerRadius="1" Margin="0,0,0,-1" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="BdForeground" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1"/>
                        <Path
                            x:Name="ExpandGlyph"
                            Width="5"
                            Height="5"
                            Data="M 2,0 C2,0 2,2 2,2 2,2 0,2 0,2 0,2 0,3 0,3 0,3 2,3 2,3 2,3 2,5 2,5 2,5 3,5 3,5 3,5 3,3 3,3 3,3 5,3 5,3 5,3 5,2 5,2 5,2 3,2 3,2 3,2 3,0 3,0 3,0 2,0 2,0 z"
                            Fill="{TemplateBinding Foreground}"/>
                        <Rectangle x:Name="CollapseGlyph" Width="5" Height="1" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed"/>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="SummaryValueKey">
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding}"/>
        </StackPanel>
    </DataTemplate>

    <!--========================================================================================shared end======================================================================================-->

    <igPrim:BoolToVisibilityConverter x:Key="boolToVisibilityConverter" />

    <!-- ObjectTypeToDataObjectConverter -->
    <igPivot:ObjectTypeToDataObjectConverter x:Key="ObjectTypeToDataObjectConverter"/>

    <!-- Left margin converter -->
    <igPrim:XamTreeLeftMarginIndentationValueConverter x:Key="LeftMarginConverter"/>

    <!-- DragTemplate -->
    <DataTemplate x:Key="dragTemplate">
        <Grid>
            <Border Opacity="0.65" Background="{StaticResource ItemHottrackCenterFill}" BorderBrush="{StaticResource ItemHottrackOuterBorderFill}" BorderThickness="1" CornerRadius="2">
                <TextBlock Text="{Binding Path=Data.Caption}" Margin="3,1"/>
            </Border>
        </Grid>
    </DataTemplate>

    <!-- HierarchyItemTemplate -->
    <ig:HierarchicalDataTemplate x:Key="hierarchyItemTemplate" ItemsSource="{Binding Path=FilterMembers}">
        <ig:HierarchicalDataTemplate.DefaultItemsContainer>
            <DataTemplate>
                <ig:XamTreeItem IsExpanded="{Binding IsExpanded, Mode=TwoWay}" IsChecked="{Binding IsSelected, Mode=TwoWay}">
                    <igPivot:XamTriggers.EventTriggers>
                        <igPivot:XamEventTrigger>
                            <igPivot:XamTreeItemLoadedAction IsEnabled="True"/>
                        </igPivot:XamEventTrigger>
                    </igPivot:XamTriggers.EventTriggers>
                </ig:XamTreeItem>
            </DataTemplate>
        </ig:HierarchicalDataTemplate.DefaultItemsContainer>
        <!-- 2nd level-->
        <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
            <ig:HierarchicalDataTemplate ItemsSource="{Binding Path=FilterMembers}" >
                <ig:HierarchicalDataTemplate.DefaultItemsContainer>
                    <DataTemplate>
                        <ig:XamTreeItem IsExpanded="{Binding IsExpanded, Mode=TwoWay}" IsChecked="{Binding IsSelected, Mode=TwoWay}">

                            <igPivot:XamTriggers.EventTriggers>
                                <igPivot:XamEventTrigger>
                                    <igPivot:XamTreeItemLoadedAction IsEnabled="True"/>
                                </igPivot:XamEventTrigger>
                            </igPivot:XamTriggers.EventTriggers>

                        </ig:XamTreeItem>
                    </DataTemplate>
                </ig:HierarchicalDataTemplate.DefaultItemsContainer>
                <!--3rd level -->
                <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                    <ig:HierarchicalDataTemplate ItemsSource="{Binding Path=FilterMembers}" >
                        <ig:HierarchicalDataTemplate.DefaultItemsContainer>
                            <DataTemplate>
                                <ig:XamTreeItem IsExpanded="{Binding IsExpanded, Mode=TwoWay}" IsChecked="{Binding IsSelected, Mode=TwoWay}">
                                    <igPivot:XamTriggers.EventTriggers>
                                        <igPivot:XamEventTrigger>
                                            <igPivot:XamTreeItemLoadedAction IsEnabled="True"/>
                                        </igPivot:XamEventTrigger>
                                    </igPivot:XamTriggers.EventTriggers>
                                </ig:XamTreeItem>
                            </DataTemplate>
                        </ig:HierarchicalDataTemplate.DefaultItemsContainer>
                        <!--4th level -->
                        <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                            <ig:HierarchicalDataTemplate ItemsSource="{Binding Path=FilterMembers}" >
                                <ig:HierarchicalDataTemplate.DefaultItemsContainer>
                                    <DataTemplate>
                                        <ig:XamTreeItem IsExpanded="{Binding IsExpanded, Mode=TwoWay}" IsChecked="{Binding IsSelected, Mode=TwoWay}">
                                            <igPivot:XamTriggers.EventTriggers>
                                                <igPivot:XamEventTrigger>
                                                    <igPivot:XamTreeItemLoadedAction IsEnabled="True"/>
                                                </igPivot:XamEventTrigger>
                                            </igPivot:XamTriggers.EventTriggers>
                                        </ig:XamTreeItem>
                                    </DataTemplate>
                                </ig:HierarchicalDataTemplate.DefaultItemsContainer>
                                <!--5th level -->
                                <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                    <ig:HierarchicalDataTemplate ItemsSource="{Binding Path=FilterMembers}">
                                        <ig:HierarchicalDataTemplate.DefaultItemsContainer>
                                            <DataTemplate>
                                                <ig:XamTreeItem IsExpanded="{Binding IsExpanded, Mode=TwoWay}" IsChecked="{Binding IsSelected, Mode=TwoWay}">
                                                    <igPivot:XamTriggers.EventTriggers>
                                                        <igPivot:XamEventTrigger>
                                                            <igPivot:XamTreeItemLoadedAction IsEnabled="True"/>
                                                        </igPivot:XamEventTrigger>
                                                    </igPivot:XamTriggers.EventTriggers>
                                                </ig:XamTreeItem>
                                            </DataTemplate>
                                        </ig:HierarchicalDataTemplate.DefaultItemsContainer>
                                        <!--6th level -->
                                        <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                            <ig:HierarchicalDataTemplate ItemsSource="{Binding Path=FilterMembers}">
                                                <ig:HierarchicalDataTemplate.DefaultItemsContainer>
                                                    <DataTemplate>
                                                        <ig:XamTreeItem IsExpanded="{Binding IsExpanded, Mode=TwoWay}" IsChecked="{Binding IsSelected, Mode=TwoWay}">
                                                            <igPivot:XamTriggers.EventTriggers>
                                                                <igPivot:XamEventTrigger>
                                                                    <igPivot:XamTreeItemLoadedAction IsEnabled="True"/>
                                                                </igPivot:XamEventTrigger>
                                                            </igPivot:XamTriggers.EventTriggers>
                                                        </ig:XamTreeItem>
                                                    </DataTemplate>
                                                </ig:HierarchicalDataTemplate.DefaultItemsContainer>
                                                <ig:HierarchicalDataTemplate.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding Path=Member.Caption}" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ig:HierarchicalDataTemplate.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="{Binding Path=Member.Caption}" />
                                                    </StackPanel>
                                                </DataTemplate>
                                            </ig:HierarchicalDataTemplate>
                                        </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                        <!--End of 6th level -->
                                        <ig:HierarchicalDataTemplate.ItemTemplate>
                                            <DataTemplate>
                                                <StackPanel Orientation="Horizontal">
                                                    <TextBlock Text="{Binding Path=Member.Caption}" />
                                                </StackPanel>
                                            </DataTemplate>
                                        </ig:HierarchicalDataTemplate.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Path=Member.Caption}" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </ig:HierarchicalDataTemplate>
                                </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                <!--End of 5th level -->
                                <ig:HierarchicalDataTemplate.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=Member.Caption}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ig:HierarchicalDataTemplate.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Path=Member.Caption}" />
                                    </StackPanel>
                                </DataTemplate>
                            </ig:HierarchicalDataTemplate>
                        </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                        <!--End of 4th level -->
                        <ig:HierarchicalDataTemplate.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=Member.Caption}" />
                                </StackPanel>
                            </DataTemplate>
                        </ig:HierarchicalDataTemplate.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Path=Member.Caption}" />
                            </StackPanel>
                        </DataTemplate>
                    </ig:HierarchicalDataTemplate>
                </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                <!--End of 3rd level -->
                <ig:HierarchicalDataTemplate.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Path=Member.Caption}" />
                        </StackPanel>
                    </DataTemplate>
                </ig:HierarchicalDataTemplate.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=Member.Caption}" />
                    </StackPanel>
                </DataTemplate>
            </ig:HierarchicalDataTemplate>
        </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Member.Caption}" />
            </StackPanel>
        </DataTemplate>
    </ig:HierarchicalDataTemplate>

    <!-- XamTreeItemDraggableStyleRootLevel -->
    <Style x:Key="XamTreeItemDraggableStyleRootLevel" TargetType="ig:XamTreeItem">
        <Setter Property="IsExpanded" Value="True"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="3,3,3,3"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ig:XamTreeItem">
                    <Grid Margin="{TemplateBinding Margin}">

                        <ig:DragDropManager.DragSource>
                            <ig:DragSource IsDraggable="True"
                                        DragTemplate="{StaticResource dragTemplate}"
                                        DataObject="{Binding Converter={StaticResource ObjectTypeToDataObjectConverter}}">
                                <igPivot:XamTriggers.EventTriggers>
                                    <igPivot:XamEventTrigger EventName="Drop">
                                        <igPivot:DropTriggerAction IsEnabled="True"/>
                                    </igPivot:XamEventTrigger>
                                    <igPivot:XamEventTrigger EventName="DragStart">
                                        <igPivot:DragStartTriggerAction IsEnabled="True"/>
                                    </igPivot:XamEventTrigger>
                                </igPivot:XamTriggers.EventTriggers>
                            </ig:DragSource>
                        </ig:DragDropManager.DragSource>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard >
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MouseOver1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:0.15" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected" >
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0000000" Storyboard.TargetName="Selected1" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" >
                                    <Storyboard >
                                        <DoubleAnimation From="1" To=".4" Duration="0" Storyboard.TargetName="ExpansionIndicator" Storyboard.TargetProperty="Opacity" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition To="Expanded" GeneratedDuration="00:00:00.2">
                                        <Storyboard BeginTime="0">
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>

                                            <DoubleAnimation To="1" Duration="00:00:00.2" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition To="Collapsed" GeneratedDuration="00:00:00.2">
                                        <Storyboard BeginTime="0">
                                            <DoubleAnimation To="0" Duration="00:00:0.2" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00.2">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation To="0" Duration="0" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualState x:Name="Active" >
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InActive">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="DropStates">
                                <VisualState x:Name="NoDrop" />
                                <VisualState x:Name="DropOnto" >
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DropOntoElem" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.15" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropBefore">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropBeforeElem" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropAfter">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropAfterElem" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>

                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0" Background="Transparent" x:Name="MouseHitArea">
                            <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
                            <Border x:Name="MouseOver1" Background="{StaticResource ItemHottrackCenterFill}" BorderBrush="{StaticResource ItemHottrackOuterBorderFill}" CornerRadius="2" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Border x:Name="Selected1" Background="{StaticResource ItemSelectedCenterFill}" BorderBrush="{StaticResource ItemSelectedOuterBorderFill}" CornerRadius="2" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Rectangle x:Name="FocusRectangle" IsHitTestVisible="False" Fill="Transparent" Visibility="Collapsed" Stroke="Black" StrokeThickness="1" StrokeDashCap="Round" StrokeDashOffset="10" StrokeDashArray="1 5"/>
                            <igPrim:ExpansionIndicator x:Name="ExpansionIndicator"
                                                    Margin="{Binding Mode=OneWay, Path=Level, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource LeftMarginConverter}, ConverterParameter=15}"
                                                    IsExpanded="{Binding Mode=TwoWay, Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}">
                                <igPrim:ExpansionIndicator.Style>
                                    <Style TargetType="igPrim:ExpansionIndicator">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="igPrim:ExpansionIndicator">
                                                    <Grid x:Name="ExpansionIndicator" Background="#00000000" >
                                                        <ContentPresenter/>
                                                    </Grid>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </igPrim:ExpansionIndicator.Style>
                                <Border>
                                    <Grid Background="Transparent">
                                        <Grid HorizontalAlignment="Left" >
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="5"/>
                                                <ColumnDefinition />
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition/>
                                            </Grid.ColumnDefinitions>
                                            <CheckBox VerticalAlignment="{TemplateBinding VerticalAlignment}" Grid.Column="2" x:Name="CheckBox"/>
                                            <ContentControl Content="{TemplateBinding Header}" IsTabStop="False" Foreground="{TemplateBinding Foreground}" Grid.Column="3" x:Name="Header" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}" />
                                        </Grid>
                                        <Grid x:Name="DropBeforeElem" Visibility="Collapsed" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
                                            <Grid.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform Y="-3"/>
                                                </TransformGroup>
                                            </Grid.RenderTransform>
                                            <Rectangle x:Name="bar" Fill="{StaticResource DropIndicatorFill}" Height="1" StrokeThickness="0"/>
                                            <Path x:Name="arrowLeft"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 166,184 C166,184 166,194 166,194 166,194 171,189 171,189 171,189 166,184 166,184 z"
                                                    Fill="{StaticResource DropIndicatorFill}" HorizontalAlignment="Left" />
                                            <Path x:Name="arrowRight"
                                                    HorizontalAlignment="Right"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 178,194 C178,194 178,184 178,184 178,184 173,189 173,189 173,189 178,194 178,194 z"
                                                    Fill="{StaticResource DropIndicatorFill}" />
                                        </Grid>
                                        <Grid x:Name="DropAfterElem" Visibility="Collapsed" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                                            <Grid.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform Y="4"/>
                                                </TransformGroup>
                                            </Grid.RenderTransform>
                                            <Rectangle x:Name="bar1" Fill="{StaticResource DropIndicatorFill}" Height="1" StrokeThickness="0"/>
                                            <Path x:Name="arrowLeft1"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 166,184 C166,184 166,194 166,194 166,194 171,189 171,189 171,189 166,184 166,184 z"
                                                    Fill="{StaticResource DropIndicatorFill}" HorizontalAlignment="Left" />
                                            <Path x:Name="arrowRight1"
                                                    HorizontalAlignment="Right"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 178,194 C178,194 178,184 178,184 178,184 173,189 173,189 173,189 178,194 178,194 z"
                                                    Fill="{StaticResource DropIndicatorFill}" />
                                        </Grid>
                                        <Rectangle x:Name="DropOntoElem" Opacity="0" Stroke="{StaticResource ItemSelectedOuterBorderFill}" StrokeThickness="2" RadiusX="2" RadiusY="2"/>
                                    </Grid>
                                </Border>
                            </igPrim:ExpansionIndicator>
                        </Grid>

                        <ItemsPresenter Grid.Row="1" x:Name="Items"/>

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

    <!-- XamTreeItemDraggableStyleChildLevels -->
    <Style x:Key="XamTreeItemDraggableStyleChildLevels" TargetType="ig:XamTreeItem">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="3,3,3,3"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ig:XamTreeItem">
                    <Grid Margin="{TemplateBinding Margin}">

                        <ig:DragDropManager.DragSource>
                            <ig:DragSource IsDraggable="True"
                                        DragTemplate="{StaticResource dragTemplate}"
                                        DataObject="{Binding Converter={StaticResource ObjectTypeToDataObjectConverter}}">
                                <igPivot:XamTriggers.EventTriggers>
                                    <igPivot:XamEventTrigger EventName="Drop">
                                        <igPivot:DropTriggerAction IsEnabled="True"/>
                                    </igPivot:XamEventTrigger>
                                    <igPivot:XamEventTrigger EventName="DragStart">
                                        <igPivot:DragStartTriggerAction IsEnabled="True"/>
                                    </igPivot:XamEventTrigger>
                                </igPivot:XamTriggers.EventTriggers>
                            </ig:DragSource>
                        </ig:DragDropManager.DragSource>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard >
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MouseOver1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:0.15" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected" >
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0000000" Storyboard.TargetName="Selected1" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" >
                                    <Storyboard >
                                        <DoubleAnimation From="1" To=".4" Duration="0" Storyboard.TargetName="ExpansionIndicator" Storyboard.TargetProperty="Opacity" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition To="Expanded" GeneratedDuration="00:00:00.2">
                                        <Storyboard BeginTime="0">
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation To="0" Duration="00:00:00.2" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="1" Duration="00:00:00.2" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="1" Duration="00:00:00.2" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition To="Collapsed" GeneratedDuration="00:00:00.2">
                                        <Storyboard BeginTime="0">
                                            <DoubleAnimation To="0" Duration="00:00:0.2" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="0" Duration="00:00:0.2" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00.2">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation To="0" Duration="0" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation To="0" Duration="0" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="0" Duration="0" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualState x:Name="Active" >
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InActive">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="DropStates">
                                <VisualState x:Name="NoDrop" />
                                <VisualState x:Name="DropOnto" >
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DropOntoElem" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.15" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropBefore">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropBeforeElem" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropAfter">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropAfterElem" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>

                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0" Background="Transparent" x:Name="MouseHitArea">
                            <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
                            <Border x:Name="MouseOver1" Background="{StaticResource ItemHottrackCenterFill}" BorderBrush="{StaticResource ItemHottrackOuterBorderFill}" CornerRadius="2" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Border x:Name="Selected1" Background="{StaticResource ItemSelectedCenterFill}" BorderBrush="{StaticResource ItemSelectedOuterBorderFill}" CornerRadius="2" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Rectangle x:Name="FocusRectangle" IsHitTestVisible="False" Fill="Transparent" Visibility="Collapsed" Stroke="Black" StrokeThickness="1" StrokeDashCap="Round" StrokeDashOffset="10" StrokeDashArray="1 5"/>
                            <igPrim:ExpansionIndicator Margin="{Binding Mode=OneWay, Path=Level, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource LeftMarginConverter}, ConverterParameter=15}"  x:Name="ExpansionIndicator" IndicatorVisibility="Collapsed"  IsExpanded="{Binding Mode=TwoWay, Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}">
                                <Border>
                                    <Grid Background="Transparent">
                                        <Grid HorizontalAlignment="Left" >
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="5"/>
                                                <ColumnDefinition />
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition/>
                                            </Grid.ColumnDefinitions>
                                            <ContentControl x:Name="ExpandedIcon" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Column="1"  Opacity="1" />
                                            <ContentControl x:Name="CollapsedIcon" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Column="1" Opacity="0"/>
                                            <CheckBox VerticalAlignment="{TemplateBinding VerticalAlignment}" Grid.Column="2" x:Name="CheckBox"/>
                                            <ContentControl Content="{TemplateBinding Header}" IsTabStop="False" Foreground="{TemplateBinding Foreground}" Grid.Column="3" x:Name="Header" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}" />
                                        </Grid>
                                        <Grid x:Name="DropBeforeElem" Visibility="Collapsed" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
                                            <Grid.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform Y="-3"/>
                                                </TransformGroup>
                                            </Grid.RenderTransform>
                                            <Rectangle x:Name="bar" Fill="{StaticResource DropIndicatorFill}" Height="1" StrokeThickness="0"/>
                                            <Path x:Name="arrowLeft"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 166,184 C166,184 166,194 166,194 166,194 171,189 171,189 171,189 166,184 166,184 z"
                                                    Fill="{StaticResource DropIndicatorFill}" HorizontalAlignment="Left" />
                                            <Path x:Name="arrowRight"
                                                    HorizontalAlignment="Right"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 178,194 C178,194 178,184 178,184 178,184 173,189 173,189 173,189 178,194 178,194 z"
                                                    Fill="{StaticResource DropIndicatorFill}" />
                                        </Grid>
                                        <Grid x:Name="DropAfterElem" Visibility="Collapsed" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                                            <Grid.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform Y="4"/>
                                                </TransformGroup>
                                            </Grid.RenderTransform>
                                            <Rectangle x:Name="bar1" Fill="{StaticResource DropIndicatorFill}" Height="1" StrokeThickness="0"/>
                                            <Path x:Name="arrowLeft1"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 166,184 C166,184 166,194 166,194 166,194 171,189 171,189 171,189 166,184 166,184 z"
                                                    Fill="{StaticResource DropIndicatorFill}" HorizontalAlignment="Left" />
                                            <Path x:Name="arrowRight1"
                                                    HorizontalAlignment="Right"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 178,194 C178,194 178,184 178,184 178,184 173,189 173,189 173,189 178,194 178,194 z"
                                                    Fill="{StaticResource DropIndicatorFill}" />
                                        </Grid>
                                        <Rectangle x:Name="DropOntoElem" Opacity="0" Stroke="{StaticResource ItemSelectedOuterBorderFill}" StrokeThickness="2" RadiusX="2" RadiusY="2"/>
                                    </Grid>
                                </Border>
                            </igPrim:ExpansionIndicator>
                        </Grid>

                        <ItemsPresenter Grid.Row="1" x:Name="Items"/>

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

    <!-- XamTreeItemStyle1 -->
    <Style x:Key="XamTreeItemStyle1" TargetType="ig:XamTreeItem">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="3,3,3,3"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ig:XamTreeItem">
                    <Grid Margin="{TemplateBinding Margin}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard >
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="MouseOver1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:0.15" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected" >
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0000000" Storyboard.TargetName="Selected1" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" >
                                    <Storyboard >
                                        <DoubleAnimation From="1" To=".4" Duration="0" Storyboard.TargetName="ExpansionIndicator" Storyboard.TargetProperty="Opacity" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition To="Expanded" GeneratedDuration="00:00:00.2">
                                        <Storyboard BeginTime="0">
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation To="0" Duration="00:00:00.2" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="1" Duration="00:00:00.2" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="1" Duration="00:00:00.2" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition To="Collapsed" GeneratedDuration="00:00:00.2">
                                        <Storyboard BeginTime="0">
                                            <DoubleAnimation To="0" Duration="00:00:0.2" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="0" Duration="00:00:0.2" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                            <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00.2">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation To="0" Duration="0" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation To="0" Duration="0" Storyboard.TargetName="Items" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="0" Duration="0" Storyboard.TargetName="ExpandedIcon" Storyboard.TargetProperty="Opacity" />
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="CollapsedIcon" Storyboard.TargetProperty="Opacity" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualState x:Name="Active" >
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <!--<ColorAnimation Storyboard.TargetName="Content" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="White" Duration="0" />-->
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InActive">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="DropStates">
                                <VisualState x:Name="NoDrop" />
                                <VisualState x:Name="DropOnto" >
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DropOntoElem" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.15" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropBefore">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropBeforeElem" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DropAfter">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropAfterElem" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0" Background="Transparent" x:Name="MouseHitArea">
                            <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
                            <Border x:Name="MouseOver1" Background="{StaticResource ItemHottrackCenterFill}" BorderBrush="{StaticResource ItemHottrackOuterBorderFill}" CornerRadius="2" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Border x:Name="Selected1" Background="{StaticResource ItemSelectedCenterFill}" BorderBrush="{StaticResource ItemSelectedOuterBorderFill}" CornerRadius="2" Visibility="Collapsed" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Rectangle x:Name="FocusRectangle" IsHitTestVisible="False" Fill="Transparent" Visibility="Collapsed" Stroke="Black" StrokeThickness="1" StrokeDashCap="Round" StrokeDashOffset="10" StrokeDashArray="1 5"/>

                            <!-- PP -->
                            <!-- This element is added just because of the binding of ExpansionIndicator.Margin property.
                        There is error in Blend3 at design time saing "Inalid XAML" when in binding expression Convertor
                        and RelativeSource attrubutes are set in the same time.-->
                            <Grid x:Name="templatedParent" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"/>

                            <igPrim:ExpansionIndicator x:Name="ExpansionIndicator"
                                                Margin="{Binding Mode=OneWay, Path=DataContext.Level, ElementName=templatedParent, Converter={StaticResource LeftMarginConverter}, ConverterParameter=15}"
                                                IndicatorVisibility="{Binding HasChildren, Converter={StaticResource boolToVisibilityConverter}}"
                                                IsExpanded="{Binding Mode=TwoWay, Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}">
                                <Border>
                                    <Grid Background="Transparent">
                                        <Grid HorizontalAlignment="Left" >
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="5"/>
                                                <ColumnDefinition />
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition/>
                                            </Grid.ColumnDefinitions>
                                            <ContentControl x:Name="ExpandedIcon" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Column="1"  Opacity="1" />
                                            <ContentControl x:Name="CollapsedIcon" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Column="1" Opacity="0"/>
                                            <CheckBox VerticalAlignment="{TemplateBinding VerticalAlignment}" Grid.Column="2" x:Name="CheckBox"/>
                                            <ContentControl Content="{TemplateBinding Header}" IsTabStop="False" Foreground="{TemplateBinding Foreground}" Grid.Column="3" x:Name="Header" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}" />
                                        </Grid>

                                        <Grid x:Name="DropBeforeElem" Visibility="Collapsed" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
                                            <Grid.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform Y="-3"/>
                                                </TransformGroup>
                                            </Grid.RenderTransform>
                                            <Rectangle x:Name="bar" Fill="{StaticResource DropIndicatorFill}" Height="1" StrokeThickness="0"/>
                                            <Path x:Name="arrowLeft"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 166,184 C166,184 166,194 166,194 166,194 171,189 171,189 171,189 166,184 166,184 z"
                                                    Fill="{StaticResource DropIndicatorFill}" HorizontalAlignment="Left" />
                                            <Path x:Name="arrowRight"
                                                    HorizontalAlignment="Right"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 178,194 C178,194 178,184 178,184 178,184 173,189 173,189 173,189 178,194 178,194 z"
                                                    Fill="{StaticResource DropIndicatorFill}" />
                                        </Grid>

                                        <Grid x:Name="DropAfterElem" Visibility="Collapsed" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                                            <Grid.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform/>
                                                    <SkewTransform/>
                                                    <RotateTransform/>
                                                    <TranslateTransform Y="4"/>
                                                </TransformGroup>
                                            </Grid.RenderTransform>
                                            <Rectangle x:Name="bar1" Fill="{StaticResource DropIndicatorFill}" Height="1" StrokeThickness="0"/>
                                            <Path x:Name="arrowLeft1"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 166,184 C166,184 166,194 166,194 166,194 171,189 171,189 171,189 166,184 166,184 z"
                                                    Fill="{StaticResource DropIndicatorFill}" HorizontalAlignment="Left" />
                                            <Path x:Name="arrowRight1"
                                                    HorizontalAlignment="Right"
                                                    Height="7"
                                                    Width="6"
                                                    Stretch="Fill"
                                                    Data="M 178,194 C178,194 178,184 178,184 178,184 173,189 173,189 173,189 178,194 178,194 z"
                                                    Fill="{StaticResource DropIndicatorFill}" />
                                        </Grid>

                                        <Rectangle x:Name="DropOntoElem" Opacity="0" Stroke="{StaticResource ItemSelectedOuterBorderFill}" StrokeThickness="2" RadiusX="2" RadiusY="2"/>
                                    </Grid>
                                </Border>
                            </igPrim:ExpansionIndicator>
                        </Grid>

                        <ItemsPresenter Grid.Row="1" x:Name="Items"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- FilterDropdown -->
    <Style x:Key="FilterDropdown" TargetType="igPivot:Dropdown">
        <!--<Setter Property="TabNavigation" Value="Once"/>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:Dropdown">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="FocusedDropDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid"/>
                                <VisualState x:Name="InvalidUnfocused"/>
                                <VisualState x:Name="InvalidFocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ContentPresenterBorder">
                            <Grid Background="{TemplateBinding Background}">
                                <ToggleButton x:Name="DropDownToggle" Style="{StaticResource FilterDropdownToggle}" HorizontalAlignment="Stretch" Margin="0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalContentAlignment="Center">
                                    <Grid>
                                        <Path
                                            x:Name="clearFilterGlyphStroke"
                                            Width="11"
                                            Height="8"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Data="M 0,0 C0,0 11,0 11,0 11,0 7,4 7,4 7,4 7,8 7,8 7,8 4,8 4,8 4,8 4,4 4,4 4,4 0,0 0,0 z"
                                            Fill="{StaticResource HeaderCellGlyphBrush}"
                                            Stretch="Fill"/>
                                        <Path
                                            x:Name="clearFilterGlyphFill"
                                            Width="7"
                                            Height="6"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Data="M 0,0 C0,0 7,0 7,0 7,0 4,3 4,3 4,3 4,6 4,6 4,6 3,6 3,6 3,6 3,3 3,3 3,3 0,0 0,0 z"
                                            Fill="#FFFFFFFF"
                                            Stretch="Fill"/>
                                    </Grid>
                                </ToggleButton>
                                <ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Grid>
                        </Border>
                        <Popup x:Name="Popup">
                            <Border x:Name="PopupBorder" Background="{StaticResource PopupBackgroundBrush}" VerticalAlignment="Top"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="3"
                                    igPivot:TemplatedParentHelper.TemplatedParent="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                <Border.Effect>
                                    <DropShadowEffect Direction="270" Opacity="0.25" ShadowDepth="3"/>
                                </Border.Effect>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>

                                    <ig:XamTree x:Name="FilterTree" BorderThickness="0" Foreground="Black" CheckBoxVisibility="Visible" Background="Transparent" CheckBoxMode="Manual"
                                                ItemContainerStyle="{StaticResource XamTreeItemStyle1}"
                                                HierarchicalItemTemplate="{StaticResource hierarchyItemTemplate}"
                                                ItemsSource="{Binding Path=FilterMembers}">
                                        <ig:XamTree.DefaultItemsContainer>
                                            <DataTemplate>
                                                <ig:XamTreeItem IsExpanded="{Binding IsExpanded, Mode=TwoWay}" IsChecked="{Binding IsSelected, Mode=TwoWay}" >
                                                    <igPivot:XamTriggers.EventTriggers>
                                                        <igPivot:XamEventTrigger>
                                                            <igPivot:XamTreeItemLoadedAction IsEnabled="True"/>
                                                        </igPivot:XamEventTrigger>
                                                    </igPivot:XamTriggers.EventTriggers>
                                                </ig:XamTreeItem>
                                            </DataTemplate>
                                        </ig:XamTree.DefaultItemsContainer>
                                    </ig:XamTree>

                                    <Border Background="{StaticResource LightGradientBrush}" VerticalAlignment="Top" CornerRadius="0,0,2,2" Grid.Row="1">
                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
                                            <Button Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSource.FilterTreeOkButtonText}"  x:Name="OKButton" Margin="5" Width="70" Cursor="Hand">
                                                <igPivot:XamTriggers.EventTriggers>
                                                    <igPivot:XamEventTrigger EventName="Click">
                                                        <igPivot:ComboBoxCloseEventTrigger IsEnabled="True"/>
                                                    </igPivot:XamEventTrigger>
                                                </igPivot:XamTriggers.EventTriggers>
                                                <ig:Commanding.Command>
                                                    <igPivot:XamPivotGridCommandSource EventName="Click" CommandType="RefreshGrid" Parameter="{Binding ElementName=FilterTree}"/>
                                                </ig:Commanding.Command>
                                            </Button>
                                            <Button Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSource.FilterTreeCancelButtonText}"
                                              x:Name="CancelButton" Margin="5" Width="70" Cursor="Hand">
                                                <igPivot:XamTriggers.EventTriggers>
                                                    <igPivot:XamEventTrigger EventName="Click">
                                                        <igPivot:ComboBoxCloseEventTrigger IsEnabled="True"/>
                                                    </igPivot:XamEventTrigger>
                                                </igPivot:XamTriggers.EventTriggers>
                                            </Button>
                                        </StackPanel>
                                    </Border>
                                </Grid>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- FilterCellRemoveBtn -->
    <Style x:Key="FilterCellRemoveBtn" TargetType="Button">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Padding" Value="0,0,0,1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="centerFill" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource closeBtnHover}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="centerFill" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource closeBtnPressed}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Ellipse x:Name="shadow" Fill="#59000000"/>
                        <Ellipse x:Name="centerFill" Fill="{StaticResource HeaderCellGlyphBrush}" Stroke="White" Margin="0,0,0,1"/>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--FieldItemControl-->
    <Style TargetType="igPivotPrim:FieldItemControl">
        <Setter Property="FontSize" Value="11" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF687887" Offset="1" />
                    <GradientStop Color="#FF9CB0C4"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="BorderBrush" Value="#BFFFFFFF"/>
        <Setter Property="BorderThickness" Value="0,0,0,1"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="Padding" Value="3,3"/>
        <Setter Property="Margin" Value="3,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivotPrim:FieldItemControl">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="closeButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="closeButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="Root" Background="Transparent">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <igPivot:Dropdown x:Name="FilterOperands" Margin="2,0,0,0" Background="{TemplateBinding Background}" Style="{StaticResource FilterDropdown}" Width="16" Cursor="Hand"/>
                                <Border BorderBrush="DarkGray" BorderThickness="0" Background="Transparent" Grid.Column="1">
                                    <ig:DragDropManager.DragSource>
                                        <ig:DragSource IsDraggable="True"
                                                        DragTemplate="{StaticResource dragTemplate}"
                                                        DataObject="{Binding}">
                                            <igPivot:XamTriggers.EventTriggers>
                                                <igPivot:XamEventTrigger EventName="Drop">
                                                    <igPivot:DropTriggerAction IsEnabled="True"/>
                                                </igPivot:XamEventTrigger>
                                                <igPivot:XamEventTrigger EventName="DragStart">
                                                    <igPivot:DragStartTriggerAction IsEnabled="True"/>
                                                </igPivot:XamEventTrigger>
                                            </igPivot:XamTriggers.EventTriggers>
                                        </ig:DragSource>
                                    </ig:DragDropManager.DragSource>

                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

                                </Border>
                                <Button x:Name="closeButton" Style="{StaticResource FilterCellRemoveBtn}" Grid.Column="2" Width="12" Height="13" Opacity="0" VerticalAlignment="Center" Margin="0,0,5,0">
                                    <Path Width="4" Height="4"  Fill="#FFFFFFFF" Data="M 0,0 C0,0 0,1 0,1 0,1 1,1 1,1 1,1 1,3 1,3 1,3 0,3 0,3 0,3 0,4 0,4 0,4 1,4 1,4 1,4 1,3 1,3 1,3 3,3 3,3 3,3 3,4 3,4 3,4 4,4 4,4 4,4 4,3 4,3 4,3 3,3 3,3 3,3 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 1,1 1,1 1,1 1,0 1,0 1,0 0,0 0,0 z"/>
                                    <ig:Commanding.Command>
                                        <igPivot:XamPivotGridCommandSource EventName="Click" CommandType="RemoveFilterCell"/>
                                    </ig:Commanding.Command>
                                </Button>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
   
    <!--FieldMeasuresItemControl-->
    <Style TargetType="igPivotPrim:FieldMeasuresItemControl">
        <Setter Property="FontSize" Value="11" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF687887" Offset="1" />
                    <GradientStop Color="#FF9CB0C4"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="BorderBrush" Value="#BFFFFFFF"/>
        <Setter Property="BorderThickness" Value="0,0,0,1"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="Padding" Value="3,3"/>
        <Setter Property="Margin" Value="3,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivotPrim:FieldMeasuresItemControl">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="closeButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="closeButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="Root" Background="Transparent">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Border BorderBrush="DarkGray" BorderThickness="0" Background="Transparent">
                                <ig:DragDropManager.DragSource>
                                    <ig:DragSource IsDraggable="True"
                                                        DragTemplate="{StaticResource dragTemplate}"
                                                        DataObject="{Binding}">
                                        <igPivot:XamTriggers.EventTriggers>
                                            <igPivot:XamEventTrigger EventName="Drop">
                                                <igPivot:DropTriggerAction IsEnabled="True"/>
                                            </igPivot:XamEventTrigger>
                                            <igPivot:XamEventTrigger EventName="DragStart">
                                                <igPivot:DragStartTriggerAction IsEnabled="True"/>
                                            </igPivot:XamEventTrigger>
                                        </igPivot:XamTriggers.EventTriggers>
                                    </ig:DragSource>
                                </ig:DragDropManager.DragSource>

                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

                            </Border>
                            <Button Grid.Column="1" x:Name="closeButton" Style="{StaticResource FilterCellRemoveBtn}" Width="12" Height="13" Opacity="0" VerticalAlignment="Center" Margin="0,0,5,0">
                                <Path Width="4" Height="4"  Fill="#FFFFFFFF" Data="M 0,0 C0,0 0,1 0,1 0,1 1,1 1,1 1,1 1,3 1,3 1,3 0,3 0,3 0,3 0,4 0,4 0,4 1,4 1,4 1,4 1,3 1,3 1,3 3,3 3,3 3,3 3,4 3,4 3,4 4,4 4,4 4,4 4,3 4,3 4,3 3,3 3,3 3,3 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 1,1 1,1 1,1 1,0 1,0 1,0 0,0 0,0 z"/>
                                <ig:Commanding.Command>
                                    <igPivot:XamPivotGridCommandSource EventName="Click" CommandType="RemoveFilterCell"/>
                                </ig:Commanding.Command>
                            </Button>

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

    <!--MeasureFieldItemControl-->
    <Style TargetType="igPivotPrim:MeasureFieldItemControl">
        <Setter Property="FontSize" Value="11" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF252C31" Offset="1"/>
                    <GradientStop Color="#FF485762" Offset="0.05"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>

        <!--<Setter Property="Background" Value="{StaticResource DarkGradientBrush}"/>-->
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="BorderBrush" Value="#BFFFFFFF"/>
        <Setter Property="BorderThickness" Value="0,0,0,1"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="Padding" Value="3,3"/>
        <Setter Property="Margin" Value="3,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivotPrim:MeasureFieldItemControl">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="closeButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="closeButton" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="Root" Background="Transparent">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Border BorderBrush="DarkGray" BorderThickness="0" Margin="2,0,0,0" Background="Transparent">
                                <ig:DragDropManager.DragSource>
                                    <ig:DragSource IsDraggable="True" DragTemplate="{StaticResource dragTemplate}"
                                                        DataObject="{Binding}"
                                                        DragChannels="Measures">
                                        <igPivot:XamTriggers.EventTriggers>
                                            <igPivot:XamEventTrigger EventName="Drop">
                                                <igPivot:DropTriggerAction IsEnabled="True"/>
                                            </igPivot:XamEventTrigger>
                                        </igPivot:XamTriggers.EventTriggers>
                                    </ig:DragSource>
                                </ig:DragDropManager.DragSource>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="0"/>

                            </Border>
                            <Button Grid.Column="1" Style="{StaticResource FilterCellRemoveBtn}" Width="12" Height="13" x:Name="closeButton" Opacity="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" >
                                <Path Width="4" Height="4"  Fill="#FFFFFFFF" Data="M 0,0 C0,0 0,1 0,1 0,1 1,1 1,1 1,1 1,3 1,3 1,3 0,3 0,3 0,3 0,4 0,4 0,4 1,4 1,4 1,4 1,3 1,3 1,3 3,3 3,3 3,3 3,4 3,4 3,4 4,4 4,4 4,4 4,3 4,3 4,3 3,3 3,3 3,3 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 1,1 1,1 1,1 1,0 1,0 1,0 0,0 0,0 z"/>
                                <ig:Commanding.Command>
                                    <igPivot:XamPivotGridCommandSource EventName="Click" CommandType="RemoveFilterCell"/>
                                </ig:Commanding.Command>
                            </Button>
                        </Grid>

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

    <!--DataSelector ComboBox Toggle Buttons-->
    <Style x:Key="DataSelectorToggleBtn" TargetType="ToggleButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="hover"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="hover"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Checkd"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                                <VisualState x:Name="Indeterminate"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="focused" Background="{StaticResource UpdateButtonHoverBrush}" CornerRadius="4,4,0,0" Opacity="0"/>
                        <Border x:Name="hover" Background="{StaticResource UpdateButtonHoverBrush}" CornerRadius="4,4,0,0" Opacity="0"/>
                        <Border x:Name="Checkd" Background="{StaticResource UpdateButtonHoverBrush}" CornerRadius="4,4,0,0" Opacity="0"/>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        <Path x:Name="BtnArrow" Stretch="Uniform" Width="8" Height="4" HorizontalAlignment="Right" Margin="0,0,8,0" Fill="#FF333333" Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Dropdown style-->
    <Style TargetType="igPivot:Dropdown">
        <Setter Property="Padding" Value="5,3,20,3"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="BorderThickness" Value="0"/>
        <!--<Setter Property="TabNavigation" Value="Once"/>-->
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:Dropdown">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value=".55"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="FocusedDropDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid"/>
                                <VisualState x:Name="InvalidUnfocused"/>
                                <VisualState x:Name="InvalidFocused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="EmptyState">
                                <VisualState x:Name="Empty">
                                </VisualState>
                                <VisualState x:Name="Selected">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ContentPresenterBorder">
                            <Grid>
                                <ToggleButton x:Name="DropDownToggle" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalContentAlignment="Right" Margin="0" Style="{StaticResource DataSelectorToggleBtn}"/>
                                <ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                   <TextBlock IsHitTestVisible="True"  x:Name="itemText" Text="{TemplateBinding EmptyString}"/>                             
                                </ContentPresenter>
                               
                            </Grid>
                        </Border>
                        <Rectangle x:Name="DisabledVisualElement" Fill="White" RadiusX="3" RadiusY="3" IsHitTestVisible="false" Opacity="0"/>
                        <Popup x:Name="Popup">
                            <Border x:Name="PopupBorder" Height="Auto" HorizontalAlignment="Stretch" BorderBrush="{StaticResource GridBorderBrush}" BorderThickness="1" CornerRadius="4">
                                <Border.Effect>
                                    <DropShadowEffect Direction="270" Opacity="0.25" ShadowDepth="3"/>
                                </Border.Effect>
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                        <GradientStop Color="#FFFEFEFE" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Padding="1">
                                    <ItemsPresenter/>
                                </ScrollViewer>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- XamHierarchicalItem -->
    <Style TargetType="igPivot:XamHierarchicalItem">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:XamHierarchicalItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ItemTypeStates">
                                <VisualState x:Name="Cube">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Cube.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Measure" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Measure.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Dimension" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Dimension.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UserDefinedHierarchy">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/HierarchyMultiple.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SystemEnabledHierarchy">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/HierarchySingle.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ParentChildHierarchy">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/HierarchyDirect.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Level1" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Level1.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Level2" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Level2.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Level3" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Level3.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Level4" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Level4.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Level5" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Level5.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Group" >
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetName="Icon"
                                            Storyboard.TargetProperty="Source">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <BitmapImage UriSource="/InfragisticsSL4.Controls.Grids.XamPivotGrid.v11.1;component/Images/Folder.png" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Background="Transparent">
                            <StackPanel Orientation="Horizontal">
                                <Image x:Name="Icon" Margin="-5, 0, 5, 0" />
                                <TextBlock Text="{Binding Path=Caption}" />
                            </StackPanel>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="igPivot:PivotHeaderCellControl" x:Key="HeaderCellKey">
        <Setter Property="FontSize" Value="11" />
        <Setter Property="Background" Value="{StaticResource HeaderNormalBackgroundBrush}"   />
        <Setter Property="Foreground" Value="{StaticResource HeaderNormalForegroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource HeaderNormalBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0,0,1,1"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="Padding" Value="8,4,0,4"/>
    </Style>

    <Style TargetType="igPivot:PivotColumnHeaderCellControl" BasedOn="{StaticResource HeaderCellKey}">
        <Setter Property="MinHeight" Value="25"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:PivotColumnHeaderCellControl">
                    <Border BorderBrush="{TemplateBinding BorderBrush}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="fill" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource HeaderHoverBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="optionsPane" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SortedStates">
                                <VisualState x:Name="NotSorted">
                                </VisualState>
                                <VisualState x:Name="Ascending">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SortedAscending" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Descending">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SortedDescending" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpantionIndicatorStates">
                                <VisualState x:Name="IndicatorCollapsed">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpansionIndicator" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="IndicatorVisible">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpansionIndicator" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SummaryStates">
                                <VisualState x:Name="SummaryValue">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TotalText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SummaryTotal">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TotalText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="AllowHeaderSorting">
                                <VisualState x:Name="EnabledHeaderSortIndicator">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HeaderSortBtn" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledHeaderSortIndicator">
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="AllowColumnHiding">
                                <VisualState x:Name="EnabledHidingIndicator">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="columnHidingVisual" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledHidingIndicator">
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="AllowColumnSorting">
                                <VisualState x:Name="EnabledSortingIndicator">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SortToggle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledSortingIndicator">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}"  x:Name="fill">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <ToggleButton Grid.Column="0" Name="ExpansionIndicator" Width="15" Height="15" Margin="3" VerticalAlignment="Center" Padding="0"
                                          Visibility="Collapsed"
                                          IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsExpanded, Mode=TwoWay}"
                                          Style="{StaticResource HeaderCellControlExpansionIndicatorStyle}"/>
                                    <StackPanel Orientation="Horizontal" Grid.Column="1" Margin="0,0,5,0" >
                                        <ContentPresenter x:Name="HeaderPresenter"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                      Margin="{TemplateBinding Padding}"
                                                      ContentTemplate="{StaticResource SummaryValueKey}" />

                                        <TextBlock Margin="3, 0, 0, 0" VerticalAlignment="Center" Visibility="Collapsed" x:Name="TotalText" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Cell.Grid.StringSetting.CellTotal}"/>
                                    </StackPanel>
                                    <Grid Grid.Column="2" Margin="0,0,5,0">
                                        <Path IsHitTestVisible="False"
                                                    x:Name="SortedDescending"
                                                    HorizontalAlignment="Center"
                                                    VerticalAlignment="Center"
                                                    Data="M 0 0 L 4 4 L 8 0 Z"
                                                    Fill="{StaticResource HeaderCellGlyphBrush}"
                                                    Visibility="Collapsed" />
                                        <Path IsHitTestVisible="False"
                                                    x:Name="SortedAscending"
                                                    HorizontalAlignment="Center"
                                                    VerticalAlignment="Center"
                                                    Data="M0,4 L8,4 L4,0 z"
                                                    Fill="{StaticResource HeaderCellGlyphBrush}"
                                                    Visibility="Collapsed"/>
                                    </Grid>
                                    <Border x:Name="optionsPane" Background="{StaticResource HeaderHoverBackgroundBrush}" Margin="5,0,0,0" Grid.ColumnSpan="4" HorizontalAlignment="Right" Opacity="1" Visibility="Collapsed">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>
                                            <ToggleButton x:Name="HeaderSortBtn" Visibility="Collapsed" Grid.Column="0" Style="{StaticResource HeaderCellSortBtn}" IsThreeState="False">
                                                <ig:Commanding.Command>
                                                    <igPivot:XamPivotGridCommandSource CommandType="SortAxisMember" EventName="Click"/>
                                                </ig:Commanding.Command>
                                            </ToggleButton>
                                            <CheckBox x:Name="SortToggle" Grid.Column="2" Visibility="Collapsed" Style="{StaticResource FilterCellSortBtn}" Margin="0,0,5,0" IsThreeState="True">
                                                <ig:Commanding.Command>
                                                    <igPivot:PivotColumnCommandSource CommandType="SortToggle" EventName="Click"/>
                                                </ig:Commanding.Command>
                                            </CheckBox>
                                            <Grid x:Name="columnHidingVisual" Background="Transparent" Width="10" Visibility="Collapsed" Grid.Column="1" Cursor="Hand">
                                                <Path
                                                    Width="8"
                                                    Height="7"
                                                    Data="M 7,0 C7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 5,4 5,4 5,4 5,5 5,5 5,5 6,5 6,5 6,5 6,6 6,6 6,6 7,6 7,6 7,6 7,7 7,7 7,7 8,7 8,7 8,7 8,5 8,5 8,5 7,5 7,5 7,5 7,4 7,4 7,4 6,4 6,4 6,4 6,3 6,3 6,3 7,3 7,3 7,3 7,2 7,2 7,2 8,2 8,2 8,2 8,0 8,0 8,0 7,0 7,0 zM 0,3 C0,3 0,4 0,4 0,4 1,4 1,4 1,4 1,5 1,5 1,5 2,5 2,5 2,5 2,6 2,6 2,6 3,6 3,6 3,6 3,7 3,7 3,7 4,7 4,7 4,7 4,6 4,6 4,6 4,5 4,5 4,5 3,5 3,5 3,5 3,4 3,4 3,4 2,4 2,4 2,4 2,3 2,3 2,3 3,3 3,3 3,3 3,2 3,2 3,2 4,2 4,2 4,2 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 2,1 2,1 2,1 2,2 2,2 2,2 1,2 1,2 1,2 1,3 1,3 1,3 0,3 0,3 z"
                                                    Fill="{StaticResource HeaderCellGlyphBrush}"/>
                                                <ig:Commanding.Command>
                                                    <igPivot:XamPivotGridCommandSource CommandType="HideAxis" EventName="MouseLeftButtonDown"/>
                                                </ig:Commanding.Command>
                                            </Grid>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="igPivot:PivotRowHeaderCellControl" BasedOn="{StaticResource HeaderCellKey}">
        <Setter Property="Padding" Value="8,4"/>
        <!--<Setter Property="MinHeight" Value="25"/>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:PivotRowHeaderCellControl">
                    <Border BorderBrush="{TemplateBinding BorderBrush}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="fill" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource HeaderHoverBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="optionsPane" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="AllowHeaderSorting">
                                <VisualState x:Name="EnabledHeaderSortIndicator">
                                    <Storyboard >
                                        <!--<DoubleAnimation Duration="0" To="13" Storyboard.TargetProperty="Width" Storyboard.TargetName="SortIndicatorColumn"/>-->
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HeaderSortBtn" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledHeaderSortIndicator">
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="AllowRowHiding">
                                <VisualState x:Name="EnabledHidingIndicator">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="columnHidingVisual" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DisabledHidingIndicator">
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpantionIndicatorStates">
                                <VisualState x:Name="IndicatorCollapsed">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpansionIndicator" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="IndicatorVisible">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpansionIndicator" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SummaryStates">
                                <VisualState x:Name="SummaryValue">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TotalText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SummaryTotal">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TotalText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CompactLayout">
                                <VisualState x:Name="OutlineLeftRightBottom">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="1,0,1,1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="headerGrid" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Center"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="OutlineRightBottom">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="0,0,1,1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="OutlineLeftRightBottomAlignBottom">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="1,0,1,1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="headerGrid" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Bottom"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="OutlineRightBottomAlignBottom">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="0,0,1,1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="headerGrid" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Bottom"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="OutlineLeftRightBottomAlignTop">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="1,0,1,1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="headerGrid" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Top"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="OutlineRightBottomAlignTop">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="0,0,1,1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="headerGrid" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Top"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="OutlineAllAlignTop">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="0,-1,0,0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="headerGrid" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Top"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="OutlineAll">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="0,-1,0,0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NormalOutline">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="BorderThickness">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="0,0,1,1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fill" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="headerGrid" Storyboard.TargetProperty="VerticalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Center"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"  x:Name="fill">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <ToggleButton Grid.Column="0" Name="ExpansionIndicator" Width="15" Height="15" Margin="3" VerticalAlignment="Center" Padding="0" Visibility="Collapsed"
                                          IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsExpanded, Mode=TwoWay}" Style="{StaticResource HeaderCellControlExpansionIndicatorStyle}"/>
                                    <Grid x:Name="headerGrid" Grid.Column="1">
                                        <StackPanel Orientation="Horizontal">
                                            <ContentPresenter x:Name="HeaderPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        Margin="{TemplateBinding Padding}" ContentTemplate="{StaticResource SummaryValueKey}" />
                                            <TextBlock VerticalAlignment="Center" Visibility="Collapsed" x:Name="TotalText" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Cell.Grid.StringSetting.CellTotal}"/>
                                        </StackPanel>
                                        <Border x:Name="optionsPane" Background="{StaticResource HeaderHoverBackgroundBrush}" Margin="5,0,0,0" HorizontalAlignment="Right" Opacity="1" Visibility="Collapsed">
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto"/>
                                                    <ColumnDefinition Width="Auto"/>
                                                    <ColumnDefinition Width="Auto"/>
                                                </Grid.ColumnDefinitions>
                                                <ToggleButton x:Name="HeaderSortBtn" Visibility="Collapsed" Grid.Column="0" Style="{StaticResource HeaderCellSortBtn}" IsThreeState="False">
                                                    <ig:Commanding.Command>
                                                        <igPivot:XamPivotGridCommandSource CommandType="SortAxisMember" EventName="Click"/>
                                                    </ig:Commanding.Command>
                                                </ToggleButton>
                                                <CheckBox x:Name="SortToggle" Grid.Column="2" Visibility="Collapsed" Style="{StaticResource FilterCellSortBtn}" Margin="0,0,5,0" IsThreeState="True">
                                                    <ig:Commanding.Command>
                                                        <igPivot:PivotColumnCommandSource CommandType="SortToggle" EventName="Click"/>
                                                    </ig:Commanding.Command>
                                                </CheckBox>
                                                <Grid x:Name="columnHidingVisual" Background="Transparent" Width="10" Visibility="Collapsed" Grid.Column="1" Cursor="Hand">
                                                    <Path Width="8" Height="7" Data="M 7,0 C7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 5,4 5,4 5,4 5,5 5,5 5,5 6,5 6,5 6,5 6,6 6,6 6,6 7,6 7,6 7,6 7,7 7,7 7,7 8,7 8,7 8,7 8,5 8,5 8,5 7,5 7,5 7,5 7,4 7,4 7,4 6,4 6,4 6,4 6,3 6,3 6,3 7,3 7,3 7,3 7,2 7,2 7,2 8,2 8,2 8,2 8,0 8,0 8,0 7,0 7,0 zM 0,3 C0,3 0,4 0,4 0,4 1,4 1,4 1,4 1,5 1,5 1,5 2,5 2,5 2,5 2,6 2,6 2,6 3,6 3,6 3,6 3,7 3,7 3,7 4,7 4,7 4,7 4,6 4,6 4,6 4,5 4,5 4,5 3,5 3,5 3,5 3,4 3,4 3,4 2,4 2,4 2,4 2,3 2,3 2,3 3,3 3,3 3,3 3,2 3,2 3,2 4,2 4,2 4,2 4,1 4,1 4,1 4,0 4,0 4,0 3,0 3,0 3,0 3,1 3,1 3,1 2,1 2,1 2,1 2,2 2,2 2,2 1,2 1,2 1,2 1,3 1,3 1,3 0,3 0,3 z" Fill="{StaticResource HeaderCellGlyphBrush}"/>
                                                    <ig:Commanding.Command>
                                                        <igPivot:XamPivotGridCommandSource CommandType="HideAxis" EventName="MouseLeftButtonDown"/>
                                                    </ig:Commanding.Command>
                                                </Grid>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Grid>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--==================================================================================specific end=========================================-->

    <!--__________________________________Data templates _____________________________-->

    <Style x:Key="treeViewItemBorderStyle" TargetType="Border">
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="Padding" Value="3,1"/>
        <Setter Property="BorderBrush" Value="{StaticResource ItemHottrackCenterFill}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="{StaticResource ItemHottrackOuterBorderFill}"/>
    </Style>

    <Style x:Key="itemBorderStyle" TargetType="Border">
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="Margin" Value="-1"/>
        <Setter Property="Padding" Value="5,1"/>
        <Setter Property="BorderBrush" Value="{StaticResource DarkGradientBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="{StaticResource LightGradientBrush}"/>
    </Style>

    <!-- Style for button that updates the layout of PivotGridView -->
    <Style x:Key="ButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="{StaticResource GridBorderBrush}"/>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="BorderThickness" Value="0,1"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStopCollection>
                            <GradientStop Offset="0" Color="#FF627684"/>
                            <GradientStop Offset="1" Color="#BFFFFFFF"/>
                        </GradientStopCollection>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource UpdateButtonHoverBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource UpdateButtonPressedBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                            <Rectangle x:Name="Background" Fill="{TemplateBinding Background}" RadiusX="3" RadiusY="3"/>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        <Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" RadiusX="3" RadiusY="3" IsHitTestVisible="false" Opacity="0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--___________________________________________ End data templates _______________________________________-->

    <!-- ClickableContainer -->
    <!--<Style TargetType="igPivotPrim:PivotSimpleClickableContainer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivotPrim:PivotSimpleClickableContainer">
                    <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"></Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->

    <!--PivotCellControl-->
    <Style TargetType="igPivot:PivotCellControl">
        <Setter Property="FontSize" Value="11" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Background" Value="{StaticResource CellItemNormalBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource CellItemNormalBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0,0,1,1"/>
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:PivotCellControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOver1" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Alternate" >
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="AltElem" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                            </VisualStateGroup>

                            <VisualStateGroup x:Name="SelectedStates">
                                <VisualState x:Name="NotSelected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="SelectedRect" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualState x:Name="InActive" />
                                <VisualState x:Name="Active">
                                    <Storyboard >
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ActiveRect" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
                        <Border x:Name="AltElem" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource CellItemAltNormalBackgroundBrush}" Visibility="Collapsed"/>
                        <Rectangle x:Name="MouseOver1" Fill="{StaticResource CellRowHoverBackgroundBrush}" Visibility="Collapsed" Margin="{TemplateBinding BorderThickness}"/>
                        <Border x:Name="SelectedRect" Background="{StaticResource CellItemSelectedBackgroundBrush}" BorderThickness="{TemplateBinding BorderThickness}"  BorderBrush="{StaticResource CellItemSelectedBorderBrush}" Visibility="Collapsed"/>
                        <Rectangle x:Name="ActiveRect"  Fill="Transparent" Stroke="{StaticResource CellItemSelectedBorderBrush}" StrokeThickness="1" Visibility="Collapsed"></Rectangle>
                        <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--===============================================================================-->
    <!--                    Field drop area control styles                             -->
    <!--===============================================================================-->

    <!--FieldsDropAreaScrollviewerButtons-->
    <Style x:Key="FieldsDropAreaScrollviewerButtons" TargetType="RepeatButton">
        <Setter Property="Background" Value="#FF1F3B53"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Width" Value="18"/>
        <Setter Property="Height" Value="24"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="hover" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pressed" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="normal" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="Transparent"/>
                        <Path x:Name="normal" Data="M9,0 L9,9 L0,4.5 z" HorizontalAlignment="Center" Stretch="Fill" UseLayoutRounding="False" Width="6" Height="9" Fill="{StaticResource GridBorderBrush}" VerticalAlignment="Center"/>
                        <Path x:Name="hover" Data="M9,0 L9,9 L0,4.5 z" HorizontalAlignment="Center" Stretch="Fill" UseLayoutRounding="False" Width="6" Height="9" Fill="{StaticResource UpdateButtonHoverBrush}" Opacity="0" VerticalAlignment="Center"/>
                        <Path x:Name="pressed" Data="M9,0 L9,9 L0,4.5 z" HorizontalAlignment="Center" Stretch="Fill" UseLayoutRounding="False" Width="6" Height="9" Fill="{StaticResource UpdateButtonPressedBrush}" Opacity="0" VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--FieldsDropAreaScrollViewerStyle-->
    <Style x:Key="FieldsDropAreaScrollViewerStyle" TargetType="ScrollViewer">
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
        <Setter Property="Padding" Value="0,4,0,4"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border>
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}"/>
                            <Rectangle Grid.Column="1" Fill="#FFE9EEF4" Grid.Row="1"/>
                            <ScrollBar x:Name="VerticalScrollBar" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Margin="0,-1,-1,-1" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Width="18"/>
                            <ScrollBar x:Name="HorizontalScrollBar" Grid.Column="0" Height="18" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Margin="-1,0,-1,-1" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="igPivotPrim:FieldsDropAreaControl">
        <Setter Property="Background" Value="{StaticResource LightGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource HeaderNormalBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0,0,1,1" />
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivotPrim:FieldsDropAreaControl">
                    <Grid>
                        <ScrollViewer Name="scrollViewer"
                                      VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                            <ItemsPresenter/>
                        </ScrollViewer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
   
    <!--FieldsDropAreaControl-->
    <Style x:Key="FieldsDropAreaControlKey" TargetType="igPivotPrim:PivotGridFieldsDropAreaControl">
        <Setter Property="Background" Value="{StaticResource LightGradientBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource HeaderNormalBorderBrush}"/>
        <Setter Property="BorderThickness" Value="0,0,1,1" />
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Padding" Value="0,5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivotPrim:PivotGridFieldsDropAreaControl">
                    <Border x:Name="panelContainer" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DisplayStates">
                                <VisualState x:Name="Empty" >
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="EmptyContentControl" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" From="0" To="0" Duration="00:00:00.40"></DoubleAnimation>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NonEmpty">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EmptyContentControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid MinHeight="30">
                            <Grid MinHeight="30">
                                <Rectangle x:Name="fill" Fill="{TemplateBinding Background}"/>
                                <Rectangle VerticalAlignment="Top" Height="4">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Offset="0" Color="#19000000"/>
                                            <GradientStop Offset="1" Color="#00ffffff"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <ContentControl x:Name="EmptyContentControl" Content="{TemplateBinding EmptyContent}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" Margin="10,0"  RenderTransformOrigin="0.5 0.5">
                                    <ContentControl.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </ContentControl.RenderTransform>
                                </ContentControl>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <RepeatButton Margin="3" Name="leftRepeat" Content="&lt;" Style="{StaticResource FieldsDropAreaScrollviewerButtons}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                                    <ScrollViewer Name="scrollViewer" Grid.Column="1" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" Style="{StaticResource FieldsDropAreaScrollViewerStyle}">
                                        <ItemsPresenter/>
                                    </ScrollViewer>
                                    <RepeatButton Margin="3" Name="rightRepeat" Content="&gt;" Grid.Column="2" Style="{StaticResource FieldsDropAreaScrollviewerButtons}" RenderTransformOrigin="0.5,0.5" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}">
                                        <RepeatButton.RenderTransform>
                                            <CompositeTransform ScaleX="-1"/>
                                        </RepeatButton.RenderTransform>
                                    </RepeatButton>
                                </Grid>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--RowsFieldDropAreaControl-->
    <Style TargetType="igPivotPrim:RowsFieldDropAreaControl"  BasedOn="{StaticResource FieldsDropAreaControlKey}">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Margin="5" x:Name="Panel" Orientation="Horizontal" Background="Transparent"
                                        HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                        igPivot:XamPivotGrid.PivotPartType="Rows">
                        <ig:DragDropManager.DropTarget>
                            <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters, MeasureList"/>
                        </ig:DragDropManager.DropTarget>
                        <igPivot:ItemsSeparatorProvider.Separator>
                            <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                        </igPivot:ItemsSeparatorProvider.Separator>
                    </StackPanel>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ColumnsFieldDropAreaControl-->
    <Style TargetType="igPivotPrim:ColumnsFieldDropAreaControl"  BasedOn="{StaticResource FieldsDropAreaControlKey}">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Margin="5" x:Name="Panel1" Orientation="Horizontal" Background="Transparent"
                                        HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                        igPivot:XamPivotGrid.PivotPartType="Columns">
                        <ig:DragDropManager.DropTarget>
                            <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters, MeasureList"/>
                        </ig:DragDropManager.DropTarget>
                        <igPivot:ItemsSeparatorProvider.Separator>
                            <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                        </igPivot:ItemsSeparatorProvider.Separator>
                    </StackPanel>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--FiltersFieldDropAreaControl-->
    <Style TargetType="igPivotPrim:FiltersFieldDropAreaControl"  BasedOn="{StaticResource FieldsDropAreaControlKey}">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Margin="5" x:Name="Panel2" Orientation="Horizontal" Background="Transparent"
                                        HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                        igPivot:XamPivotGrid.PivotPartType="Filters">
                        <ig:DragDropManager.DropTarget>
                            <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters"/>
                        </ig:DragDropManager.DropTarget>
                        <igPivot:ItemsSeparatorProvider.Separator>
                            <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                        </igPivot:ItemsSeparatorProvider.Separator>
                    </StackPanel>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--MeasuresFieldDropAreaControl-->
    <Style TargetType="igPivotPrim:MeasuresFieldDropAreaControl"  BasedOn="{StaticResource FieldsDropAreaControlKey}">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Margin="5" x:Name="Panel3" Orientation="Horizontal" Background="Transparent"
                                        HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                        igPivot:XamPivotGrid.PivotPartType="Measures">
                        <ig:DragDropManager.DropTarget>
                            <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Measures"/>
                        </ig:DragDropManager.DropTarget>
                        <igPivot:ItemsSeparatorProvider.Separator>
                            <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                        </igPivot:ItemsSeparatorProvider.Separator>
                    </StackPanel>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- FieldItemTemplateKey -->
    <DataTemplate x:Key="FieldItemTemplateKey">
        <Border Background="Transparent">
            <TextBlock Text="{Binding Caption}" VerticalAlignment="Center"/>
        </Border>
    </DataTemplate>

    <!-- Expander Button Style -->
    <Style x:Key="ExpanderButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="{StaticResource ExpanderButtonBackgroundBrush}"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{StaticResource GridBorderBrush}"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <Rectangle Fill="{TemplateBinding Background}"/>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Expander default style -->
    <Style TargetType="igPivot:Expander">
        <Setter Property="Background" Value="{StaticResource ExpanderBackgroundBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{StaticResource DarkGradientBrush}"/>
        <Setter Property="HeaderBackground" Value="{StaticResource LightGradientBrush}"/>
        <Setter Property="HeaderBorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:Expander">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualState x:Name="Collapsed"/>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="HeaderBorder" Storyboard.TargetProperty="(Grid.RowSpan)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Int32>1</System:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="HeaderBorder" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Int32>2</System:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Header" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00" Storyboard.TargetName="ContentBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00" Storyboard.TargetName="OuterShdw" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00" Storyboard.TargetName="ExpandGlyph" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00" Storyboard.TargetName="CollapseGlyph" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                            <Grid Margin="{TemplateBinding Padding}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Rectangle x:Name="InnerShdw" Fill="{StaticResource InnerShdwBrush}" Height="15" VerticalAlignment="Top" Grid.RowSpan="2" Grid.ColumnSpan="3"/>
                                <Border x:Name="OuterShdw" BorderBrush="#0C000000" BorderThickness="0,0,0,1" CornerRadius="7" Grid.Column="1" Grid.ColumnSpan="2" Margin="5" Visibility="Collapsed">
                                    <Border x:Name="MiddleShdw" BorderBrush="#19000000" BorderThickness="1,0,1,1" CornerRadius="6">
                                        <Border x:Name="InsideShdw" BorderBrush="#3F000000" BorderThickness="1" CornerRadius="5">
                                            <Border x:Name="HeaderBorder" CornerRadius="4" Background="{TemplateBinding HeaderBackground}" BorderBrush="{TemplateBinding HeaderBorderBrush}" BorderThickness="{TemplateBinding HeaderBorderThickness}">
                                                <StackPanel Orientation="Horizontal">
                                                    <!--<Button x:Name="ExpansionButton" Style="{StaticResource ExpanderButtonStyle}" Margin="1" HorizontalAlignment="Left" Content="&lt;" VerticalContentAlignment="Center"/>-->
                                                    <ContentPresenter x:Name="Header"
                                                     Visibility="Collapsed"
                                                     Cursor="{TemplateBinding Cursor}"
                                                     Content="{TemplateBinding Header}"
                                                     ContentTemplate="{TemplateBinding HeaderTemplate}"
                                                     Margin="5"/>
                                                </StackPanel>
                                            </Border>
                                        </Border>
                                    </Border>
                                </Border>
                                <Border x:Name="ContentBorder" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Visibility="Collapsed" Margin="5,0,5,5">
                                    <ContentPresenter x:Name="Content" Cursor="{TemplateBinding Cursor}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                </Border>
                                <Button x:Name="ExpansionButton" Style="{StaticResource ExpanderButtonStyle}" Width="9" Grid.RowSpan="2" Margin="1" VerticalContentAlignment="Center">
                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <Grid x:Name="ExpandGlyph">
                                            <Path Width="3" Height="5" Margin="0,2,0,0"
                                            Data="M 0,2 C0,2 0,3 0,3 0,3 1,3 1,3 1,3 1,4 1,4 1,4 2,4 2,4 2,4 2,5 2,5 2,5 3,5 3,5 3,5 3,0 3,0 3,0 2,0 2,0 2,0 2,1 2,1 2,1 1,1 1,1 1,1 1,2 1,2 1,2 0,2 0,2 z" Stretch="Fill"
                                            Fill="#FFFFFFFF"/>
                                            <Path Width="3" Height="5"
                                            Data="M 0,2 C0,2 0,3 0,3 0,3 1,3 1,3 1,3 1,4 1,4 1,4 2,4 2,4 2,4 2,5 2,5 2,5 3,5 3,5 3,5 3,0 3,0 3,0 2,0 2,0 2,0 2,1 2,1 2,1 1,1 1,1 1,1 1,2 1,2 1,2 0,2 0,2 z" Stretch="Fill"
                                            Fill="{StaticResource GridBorderBrush}"/>
                                        </Grid>
                                        <Grid x:Name="CollapseGlyph" Visibility="Collapsed">
                                            <Path Width="3" Height="5" Margin="0,2,0,0"
                                            Data="M 3,2 C3,2 3,3 3,3 3,3 2,3 2,3 2,3 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 0,5 0,5 0,5 0,0 0,0 0,0 1,0 1,0 1,0 1,1 1,1 1,1 2,1 2,1 2,1 2,2 2,2 2,2 3,2 3,2 z"
                                            Stretch="Fill" Fill="#FFFFFFFF"/>
                                            <Path Width="3" Height="5"
                                            Data="M 3,2 C3,2 3,3 3,3 3,3 2,3 2,3 2,3 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 0,5 0,5 0,5 0,0 0,0 0,0 1,0 1,0 1,0 1,1 1,1 1,1 2,1 2,1 2,1 2,2 2,2 2,2 3,2 3,2 z"
                                            Stretch="Fill" Fill="{StaticResource GridBorderBrush}"/>
                                        </Grid>
                                    </Grid>
                                </Button>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="CubeDataTemplate">
        <Grid>
            <Grid Background="Transparent">
                <StackPanel Orientation="Horizontal">
                    <Image Source="/Infragistics.Windows.DataVisualization.PivotGrid.v11.1;component/Images/Cube.png" />
                    <TextBlock Text="{Binding Path=Caption}" />
                </StackPanel>
            </Grid>
        </Grid>
    </DataTemplate>

    <!-- XamPivotDataSelector -->
    <Style TargetType="igPivot:XamPivotDataSelector">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:XamPivotDataSelector">
                    <Grid x:Name="LayoutRoot" igPivot:XamPivotGrid.PivotPartType="DeleteArea"
                          Background="{TemplateBinding Background}"
                          igPivot:TemplatedParentHelper.TemplatedParent="{Binding RelativeSource={RelativeSource TemplatedParent}}">

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DataSourceTypeVisualParts">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="FlatDataSource">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DropDownsPanel" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <ig:DragDropManager.DropTarget>
                            <ig:DropTarget IsDropTarget="True" DropChannels="Measures, Rows, Columns, Filters, MeasureList"/>
                        </ig:DragDropManager.DropTarget>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="210"/>
                            </Grid.RowDefinitions>
                            <Border x:Name="OuterShdw" BorderBrush="#0C000000" BorderThickness="0,0,0,1" CornerRadius="7">
                                <Border x:Name="MiddleShdw" BorderBrush="#19000000" BorderThickness="1,0,1,1" CornerRadius="6">
                                    <Border x:Name="InsideShdw" BorderBrush="#3F000000" BorderThickness="1" CornerRadius="5">
                                        <Border x:Name="Bd" CornerRadius="4" Background="{StaticResource LightGradientBrush}" Padding="5">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="Auto"/>
                                                    <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>

                                                <Grid Grid.Row="0" x:Name="DropDownsPanel">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>

                                                    <!--Databases drop-down-->
                                                    <Grid Grid.Row="0">
                                                        <igPivot:Dropdown x:Name="DatabasesDropDown" EmptyString="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.DatabasesDropDownInitialText}"
                                                              ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Databases}"
                                                              SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Database, Mode=TwoWay}">
                                                            <ComboBox.ItemTemplate>
                                                                <DataTemplate>
                                                                    <TextBlock Text="{Binding Path=Name}" />
                                                                </DataTemplate>
                                                            </ComboBox.ItemTemplate>
                                                        </igPivot:Dropdown>
                                                        <Border x:Name="DatabaseSeparator" Background="{StaticResource CubeDropdownSeparatorDarkBrush}" BorderBrush="{StaticResource CubeDropdownSeparatorLightBrush}" BorderThickness="0,0,0,1" Height="2" VerticalAlignment="Bottom"/>
                                                    </Grid>

                                                    <!--Cubes drop-down-->
                                                    <Grid Grid.Row="1">
                                                        <igPivot:Dropdown x:Name="CubesDropDown" EmptyString="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.CubesDropDownInitialText}"
                                                              ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Cubes}"
                                                              SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Cube, Mode=TwoWay}">
                                                            <ComboBox.ItemTemplate>
                                                                <DataTemplate>
                                                                    <TextBlock Text="{Binding Path=Caption}" />
                                                                </DataTemplate>
                                                            </ComboBox.ItemTemplate>
                                                        </igPivot:Dropdown>
                                                        <Border x:Name="Separator" Background="{StaticResource CubeDropdownSeparatorDarkBrush}" BorderBrush="{StaticResource CubeDropdownSeparatorLightBrush}" BorderThickness="0,0,0,1" Height="2" VerticalAlignment="Bottom"/>
                                                    </Grid>

                                                    <!--Measure groups drop-down-->
                                                    <Grid Grid.Row="2">
                                                        <igPivot:Dropdown x:Name="MeasureGroupsDropDown"  EmptyString="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.MeasureGroupsDropDownInitialText}"
                                                              ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.MeasureGroups}"
                                                              SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.MeasureGroup, Mode=TwoWay}">
                                                            <ComboBox.ItemTemplate>
                                                                <DataTemplate>
                                                                    <TextBlock Text="{Binding Path=Name}" />
                                                                </DataTemplate>
                                                            </ComboBox.ItemTemplate>
                                                        </igPivot:Dropdown>
                                                        <Border x:Name="MeasureGroupsSeparator" Background="{StaticResource CubeDropdownSeparatorDarkBrush}" BorderBrush="{StaticResource CubeDropdownSeparatorLightBrush}" BorderThickness="0,0,0,1" Height="2" VerticalAlignment="Bottom"/>
                                                    </Grid>
                                                </Grid>

                                                <!--Metadata Tree -->
                                                <Border x:Name="DimensionsTreeBd" Grid.Row="3" CornerRadius="4" Background="{StaticResource LightGradientBrush}" Padding="5" Margin="0,5">
                                                    <Grid>
                                                        <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.DimensionsAreaBackgroundText}" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.15"/>
                                                        <ig:XamTree x:Name="DimensionsTree"
                                                                           Background="Transparent"
                                                                           ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Metadata}"
                                                                           BorderThickness="0"
                                                                           ItemContainerStyle="{StaticResource XamTreeItemDraggableStyleRootLevel}"
                                                                           >

                                                            <ig:XamTree.HierarchicalItemTemplate>
                                                                <ig:HierarchicalDataTemplate
                                                                    ItemContainerStyle="{StaticResource XamTreeItemDraggableStyleChildLevels}"
                                                                    ItemsSource="{Binding Path=Items}"
                                                                    >
                                                                    <!-- 1st level items -->
                                                                    <DataTemplate >
                                                                        <igPivot:XamHierarchicalItem HierarchicalItem="{Binding}" />
                                                                    </DataTemplate>

                                                                    <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                                                        <ig:HierarchicalDataTemplate
                                                                            ItemContainerStyle="{StaticResource XamTreeItemDraggableStyleChildLevels}"
                                                                            ItemsSource="{Binding Path=Items}">
                                                                            <!-- 2nd level items -->
                                                                            <DataTemplate >
                                                                                <igPivot:XamHierarchicalItem HierarchicalItem="{Binding}" />
                                                                            </DataTemplate>

                                                                            <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                                                                <ig:HierarchicalDataTemplate
                                                                                    ItemContainerStyle="{StaticResource XamTreeItemDraggableStyleChildLevels}"
                                                                                    ItemsSource="{Binding Path=Items}">
                                                                                    <!-- 3rd level items -->
                                                                                    <DataTemplate >
                                                                                        <igPivot:XamHierarchicalItem HierarchicalItem="{Binding}" />
                                                                                    </DataTemplate>

                                                                                    <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                                                                        <ig:HierarchicalDataTemplate
                                                                                            ItemContainerStyle="{StaticResource XamTreeItemDraggableStyleChildLevels}"
                                                                                            ItemsSource="{Binding Path=Items}">
                                                                                            <!-- 4th level items -->
                                                                                            <DataTemplate >
                                                                                                <igPivot:XamHierarchicalItem HierarchicalItem="{Binding}" />
                                                                                            </DataTemplate>

                                                                                            <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                                                                                <ig:HierarchicalDataTemplate
                                                                                                    ItemContainerStyle="{StaticResource XamTreeItemDraggableStyleChildLevels}"
                                                                                                    ItemsSource="{Binding Path=Items}">
                                                                                                    <!-- 5th level items -->
                                                                                                    <DataTemplate >
                                                                                                        <igPivot:XamHierarchicalItem HierarchicalItem="{Binding}" />
                                                                                                    </DataTemplate>

                                                                                                </ig:HierarchicalDataTemplate>
                                                                                            </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>

                                                                                        </ig:HierarchicalDataTemplate>
                                                                                    </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                                                                </ig:HierarchicalDataTemplate>
                                                                            </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                                                        </ig:HierarchicalDataTemplate>
                                                                    </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                                                                </ig:HierarchicalDataTemplate>
                                                            </ig:XamTree.HierarchicalItemTemplate>

                                                        </ig:XamTree>
                                                    </Grid>
                                                </Border>

                                            </Grid>
                                        </Border>
                                    </Border>
                                </Border>
                            </Border>
                            <!-- View Model Collections -->
                            <Border x:Name="ViewModelsOuterShdw" BorderBrush="#0C000000" BorderThickness="0,0,0,1" CornerRadius="7" Grid.Row="1" Margin="0,5,0,0" >
                                <Border x:Name="ViewModelsMiddleShdw" BorderBrush="#19000000" BorderThickness="1,0,1,1" CornerRadius="6">
                                    <Border x:Name="ViewModelsInsideShdw" BorderBrush="#3F000000" BorderThickness="1" CornerRadius="5">
                                        <Border x:Name="ViewModelsBd" CornerRadius="4" Background="{StaticResource LightGradientBrush}" Padding="5">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="Auto"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="5"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="5"/>
                                                    <RowDefinition Height="Auto"/>
                                                </Grid.RowDefinitions>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*"/>
                                                    <ColumnDefinition Width="4"/>
                                                    <ColumnDefinition Width="*"/>
                                                </Grid.ColumnDefinitions>

                                                <!-- Header Labels -->
                                                <TextBlock Grid.ColumnSpan="3" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.PanelCollectionsAreaLabel}" Margin="0,0,0,5"/>

                                                <!-- Filters ListBox -->
                                                <Grid Grid.Row="1">
                                                    <Border BorderThickness="0,0,0,1" BorderBrush="#BFFFFFFF" CornerRadius="5">
                                                        <Border Background="#FFFFFFFF" BorderThickness="1" BorderBrush="{StaticResource GridBorderBrush2}" CornerRadius="4">
                                                            <Grid>
                                                                <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.FiltersAreaBackgroundText}" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.15"/>

                                                                <igPivotPrim:FieldsDropAreaControl Grid.ColumnSpan="2" x:Name="FiltersDropArea" igPivot:XamPivotGrid.PivotPartType="Filters"
                                                                                                         ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Filters, Mode=TwoWay}"
                                                                                                         ItemTemplate="{StaticResource FieldItemTemplateKey}">
                                                                    <igPivotPrim:FieldsDropAreaControl.ItemsPanel>
                                                                        <ItemsPanelTemplate>
                                                                            <StackPanel Orientation="Vertical" Background="Transparent"
                                                                                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                                                                            igPivot:XamPivotGrid.PivotPartType="Filters">
                                                                                <ig:DragDropManager.DropTarget>
                                                                                    <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters"/>
                                                                                </ig:DragDropManager.DropTarget>
                                                                                <igPivot:ItemsSeparatorProvider.Separator>
                                                                                    <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                                                                                </igPivot:ItemsSeparatorProvider.Separator>
                                                                            </StackPanel>
                                                                        </ItemsPanelTemplate>
                                                                    </igPivotPrim:FieldsDropAreaControl.ItemsPanel>

                                                                </igPivotPrim:FieldsDropAreaControl>

                                                                <Border x:Name="FiltersInsetShdw" CornerRadius="3,3,0,0" Height="4" VerticalAlignment="Top">
                                                                    <Border.Background>
                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                            <GradientStop Color="#33000000" Offset="0"/>
                                                                            <GradientStop Color="Transparent" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Border.Background>
                                                                </Border>
                                                            </Grid>
                                                        </Border>
                                                    </Border>
                                                </Grid>

                                                <!-- Columns ListBox -->
                                                <Grid Grid.Row="1" Grid.Column="2">
                                                    <Border BorderThickness="0,0,0,1" BorderBrush="#BFFFFFFF" CornerRadius="5">
                                                        <Border Background="#FFFFFFFF" BorderThickness="1" BorderBrush="{StaticResource GridBorderBrush2}" CornerRadius="4">
                                                            <Grid>
                                                                <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.ColumnsAreaBackgroundText}" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.15"/>
                                                                <igPivotPrim:FieldsDropAreaControl Grid.ColumnSpan="2" x:Name="ColumnsDropArea" igPivot:XamPivotGrid.PivotPartType="Columns"
                                                                                                         ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Columns, Mode=TwoWay}"
                                                                                                         ItemTemplate="{StaticResource FieldItemTemplateKey}">
                                                                    <igPivotPrim:FieldsDropAreaControl.ItemsPanel>
                                                                        <ItemsPanelTemplate>
                                                                            <StackPanel Orientation="Vertical" Background="Transparent"
                                                                                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                                                                            igPivot:XamPivotGrid.PivotPartType="Columns">
                                                                                <ig:DragDropManager.DropTarget>
                                                                                    <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters, MeasureList"/>
                                                                                </ig:DragDropManager.DropTarget>
                                                                                <igPivot:ItemsSeparatorProvider.Separator>
                                                                                    <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                                                                                </igPivot:ItemsSeparatorProvider.Separator>
                                                                            </StackPanel>
                                                                        </ItemsPanelTemplate>
                                                                    </igPivotPrim:FieldsDropAreaControl.ItemsPanel>

                                                                </igPivotPrim:FieldsDropAreaControl>
                                                                <Border x:Name="ColumnsInsetShdw" CornerRadius="3,3,0,0" Height="4" VerticalAlignment="Top">
                                                                    <Border.Background>
                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                            <GradientStop Color="#33000000" Offset="0"/>
                                                                            <GradientStop Color="Transparent" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Border.Background>
                                                                </Border>
                                                            </Grid>
                                                        </Border>
                                                    </Border>
                                                </Grid>

                                                <!-- Rows ListBox -->
                                                <Grid Grid.Row="3">
                                                    <Border BorderThickness="0,0,0,1" BorderBrush="#BFFFFFFF" CornerRadius="5">
                                                        <Border Background="#FFFFFFFF" BorderThickness="1" BorderBrush="{StaticResource GridBorderBrush2}" CornerRadius="4">
                                                            <Grid>
                                                                <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.RowsAreaBackgroundText}" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.15"/>

                                                                <igPivotPrim:FieldsDropAreaControl Grid.ColumnSpan="2" x:Name="RowsDropArea" igPivot:XamPivotGrid.PivotPartType="Rows"
                                                                                                         ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Rows, Mode=TwoWay}"
                                                                                                         ItemTemplate="{StaticResource FieldItemTemplateKey}">
                                                                    <igPivotPrim:FieldsDropAreaControl.ItemsPanel>
                                                                        <ItemsPanelTemplate>
                                                                            <StackPanel Orientation="Vertical" Background="Transparent"
                                                                                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                                                                            igPivot:XamPivotGrid.PivotPartType="Rows">
                                                                                <ig:DragDropManager.DropTarget>
                                                                                    <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters, MeasureList"/>
                                                                                </ig:DragDropManager.DropTarget>
                                                                                <igPivot:ItemsSeparatorProvider.Separator>
                                                                                    <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                                                                                </igPivot:ItemsSeparatorProvider.Separator>
                                                                            </StackPanel>
                                                                        </ItemsPanelTemplate>
                                                                    </igPivotPrim:FieldsDropAreaControl.ItemsPanel>

                                                                </igPivotPrim:FieldsDropAreaControl>
                                                                <Border x:Name="RowsInsetShdw" CornerRadius="3,3,0,0" Height="4" VerticalAlignment="Top">
                                                                    <Border.Background>
                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                            <GradientStop Color="#33000000" Offset="0"/>
                                                                            <GradientStop Color="Transparent" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Border.Background>
                                                                </Border>
                                                            </Grid>
                                                        </Border>
                                                    </Border>
                                                </Grid>

                                                <!-- Measures ListBox -->
                                                <Grid Grid.Row="3" Grid.Column="2">
                                                    <Border BorderThickness="0,0,0,1" BorderBrush="#BFFFFFFF" CornerRadius="5">
                                                        <Border Background="#FFFFFFFF" BorderThickness="1" BorderBrush="{StaticResource GridBorderBrush2}" CornerRadius="4">
                                                            <Grid>
                                                                <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.MeasuresAreaBackgroundText}" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.15"/>
                                                             
                                                                <igPivotPrim:FieldsDropAreaControl Grid.ColumnSpan="2" x:Name="MeasuresDropArea"
                                                                                                         ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Measures, Mode=TwoWay}"
                                                                                                         ItemTemplate="{StaticResource FieldItemTemplateKey}">
                                                                    <igPivotPrim:FieldsDropAreaControl.ItemsPanel>
                                                                        <ItemsPanelTemplate>
                                                                            <StackPanel Orientation="Vertical" Background="Transparent"
                                                                                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                                                                            igPivot:XamPivotGrid.PivotPartType="Measures">
                                                                                <ig:DragDropManager.DropTarget>
                                                                                    <ig:DropTarget IsDropTarget="True" DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Measures"/>
                                                                                </ig:DragDropManager.DropTarget>
                                                                                <igPivot:ItemsSeparatorProvider.Separator>
                                                                                    <igPivot:PanelItemsSeparator SeparatorColor="#FF6E7E8D"/>
                                                                                </igPivot:ItemsSeparatorProvider.Separator>
                                                                            </StackPanel>
                                                                        </ItemsPanelTemplate>
                                                                    </igPivotPrim:FieldsDropAreaControl.ItemsPanel>

                                                                </igPivotPrim:FieldsDropAreaControl>
                                                                <Border x:Name="MeasuresInsetShdw" CornerRadius="3,3,0,0" Height="4" VerticalAlignment="Top">
                                                                    <Border.Background>
                                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                            <GradientStop Color="#33000000" Offset="0"/>
                                                                            <GradientStop Color="Transparent" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Border.Background>
                                                                </Border>
                                                            </Grid>
                                                        </Border>
                                                    </Border>
                                                </Grid>

                                                <!-- Layout Update Controlers -->
                                                <CheckBox x:Name="DeferredUpdateLayout" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.DeferredUpdateLayoutCheckBoxLabel}"
                                                                IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.DeferredLayoutUpdate, Mode=TwoWay}"/>

                                                <Button x:Name="UpdateLayoutButton" Grid.Row="5" Grid.Column="2" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=StringSetting.UpdateLayoutButtonText}" VerticalContentAlignment="Center" HorizontalAlignment="Stretch" IsEnabled="{Binding ElementName=DeferredUpdateLayout, Path=IsChecked}" Style="{StaticResource ButtonStyle}">
                                                    <ig:Commanding.Command>
                                                        <igPivot:XamPivotGridCommandSource EventName="Click" CommandType="RefreshGridImmediately"/>
                                                    </ig:Commanding.Command>
                                                </Button>
                                            </Grid>
                                        </Border>
                                    </Border>
                                </Border>
                            </Border>
                        </Grid>

                    </Grid>
                </ControlTemplate>

            </Setter.Value>
        </Setter>
    </Style>

    <!--__________________________________ ResizingIndicator _____________________________________________________-->
    <Style TargetType="igPivotPrim:PivotResizingIndicator">
        <Setter Property="Background" Value="{StaticResource ResizeIndicatorBrush}"/>
        <Setter Property="Width" Value="4"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivotPrim:PivotResizingIndicator">
                    <Canvas>
                        <Rectangle x:Name="FillIndicator" Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{Binding Path=Height,RelativeSource={RelativeSource TemplatedParent}}"></Rectangle>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- *********************************  Editor Style  ********************************* -->

    <Style x:Key="EditorStyle" TargetType="TextBox">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Foreground" Value="#FF333333"/>
        <Setter Property="BorderBrush" Value="{StaticResource DarkGradientBrush}"/>
        <Setter Property="Background" Value="#D8FFFFFF"/>
    </Style>

    <Style x:Key="AxisChooserKey" TargetType="igPivot:Dropdown">
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="TabNavigation" Value="Once"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:Dropdown">
                    <Grid>
                        <Border x:Name="ContentPresenterBorder" Padding="5" >
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF687887" Offset="1" />
                                    <GradientStop Color="#FF9CB0C4"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <ToggleButton x:Name="DropDownToggle" Style="{StaticResource FilterDropdownToggle}"
                                                      BorderBrush="{TemplateBinding BorderBrush}"
                                                      BorderThickness="{TemplateBinding BorderThickness}"
                                                      Background="{TemplateBinding Background}"
                                                      HorizontalAlignment="Stretch" HorizontalContentAlignment="Right" Margin="0"
                                                      VerticalAlignment="Stretch">
                                </ToggleButton>
                            </Grid>
                        </Border>
                        <Popup x:Name="Popup">
                            <Border x:Name="PopupBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="Auto">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                        <GradientStop Color="#FFFEFEFE" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Padding="1">
                                    <ItemsPresenter/>
                                </ScrollViewer>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="AxisChooserTemplateKey">
        <TextBlock Text="{Binding Path=HeaderText}"/>
    </DataTemplate>

    <!--XamPivotGrid-->
    <Style TargetType="igPivot:XamPivotGrid">
        <Setter Property="FontSize" Value="11" />
        <Setter Property="EditorStyle" Value="{StaticResource EditorStyle}"/>
        <Setter Property="Background" Value="{StaticResource GridBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource GridBorderBrush}"/>
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="Padding" Value="5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igPivot:XamPivotGrid">
                    <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="LayoutRoot" igPivot:TemplatedParentHelper.TemplatedParent="{Binding RelativeSource={RelativeSource TemplatedParent}}" igPivot:XamPivotGrid.PivotPartType="DeleteArea" Background="Transparent">
                            <ig:DragDropManager.DropTarget>
                                <ig:DropTarget IsDropTarget="True" DropChannels="Measures, Rows, Columns, Filters, MeasureList"/>
                            </ig:DragDropManager.DropTarget>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" x:Name="LeftColumn"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <igPivotPrim:ColumnsFieldDropAreaControl Grid.Column="1" Grid.Row="1" x:Name="ColumnsDropArea" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Columns, Mode=TwoWay}" ItemTemplate="{StaticResource FieldItemTemplateKey}"/>
                                <igPivotPrim:FiltersFieldDropAreaControl Grid.ColumnSpan="2" x:Name="FiltersDropArea" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Filters, Mode=TwoWay}" ItemTemplate="{StaticResource FieldItemTemplateKey}"/>
                                <igPivotPrim:MeasuresFieldDropAreaControl AllowResizing="Right" Grid.Row="1" x:Name="MeasuresDropArea" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Measures, Mode=TwoWay}" ItemTemplate="{StaticResource FieldItemTemplateKey}"/>
                            </Grid>
                            <Grid Grid.Row="1" Grid.ColumnSpan="1" x:Name="GridControlLayout">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <igPivot:PivotGridPanel x:Name="MainLayout" SharedSizeColumn="{Binding ElementName=LeftColumn}">
                                    <ig:PivotDataRowsPanel x:Name="DataRowsPanel" Canvas.ZIndex="-2">
                                        <ig:DragDropManager.DropTarget>
                                            <ig:DropTarget IsDropTarget="True"  DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Measures"/>
                                        </ig:DragDropManager.DropTarget>
                                    </ig:PivotDataRowsPanel>
                                    <ig:PivotRowsPanel x:Name="RowsHeaderPanel" Canvas.ZIndex="-1">
                                        <ig:DragDropManager.DropTarget>
                                            <ig:DropTarget IsDropTarget="True"  DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters, MeasureList"/>
                                        </ig:DragDropManager.DropTarget>
                                    </ig:PivotRowsPanel>
                                    <ig:PivotColumnsPanel x:Name="ColumnsHeaderPanel" Canvas.ZIndex="-1">
                                        <ig:DragDropManager.DropTarget>
                                            <ig:DropTarget IsDropTarget="True"  DropTargetMarkerBrush="#FF6E7E8D" DropChannels="Rows, Columns, Filters, MeasureList"/>
                                        </ig:DragDropManager.DropTarget>
                                    </ig:PivotColumnsPanel>
                                    <igPivotPrim:RowsFieldDropAreaControl AllowResizing="Right" igPivot:PivotGridPanel.IsTopLeftCornerControl ="True" x:Name="RowsDropArea" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataSource.Rows, Mode=TwoWay}" ItemTemplate="{StaticResource FieldItemTemplateKey}"/>
                                    <igPivot:Dropdown x:Name="ColumnChooser" ItemTemplate="{StaticResource AxisChooserTemplateKey}" Style="{StaticResource AxisChooserKey}"/>
                                    <igPivot:Dropdown x:Name="RowChooser"  ItemTemplate="{StaticResource AxisChooserTemplateKey}" Style="{StaticResource AxisChooserKey}"/>
                                </igPivot:PivotGridPanel>
                                <ScrollBar x:Name="VerticalScrollBar" Width="20" Grid.Column="1"/>
                                <ScrollBar x:Name="HorizontalScrollBar"  Height="20" Grid.Row="1"/>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

 

Thanks

Sangeetha