<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
					xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					
				
					xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"     
					xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
					xmlns:treelist="clr-namespace:Telerik.Windows.Controls.TreeListView;assembly=Telerik.Windows.Controls.GridView"
					xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
				
				
			
	>

	<telerik:Expression_DarkTheme x:Key="Theme" />
<SolidColorBrush x:Key="ControlOuterBorder" Color="#FF000000"/>
<SolidColorBrush x:Key="GridView_GroupRowIndicator" Color="#FFC5C2C2" />
<SolidColorBrush x:Key="GridView_RowIndicatorCellBackground" Color="#FF575859" />
<SolidColorBrush x:Key="GridView_GroupRowBackground" Color="#FF575859" />
<SolidColorBrush x:Key="GridView_GridLinesItemBorder" Color="Black" />

	
	
	<telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

	
	<Storyboard x:Key="Expand">		
		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
			<SplineDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
		</DoubleAnimationUsingKeyFrames>
	</Storyboard>
	<Storyboard x:Key="Collapse">
		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExpanderButton" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
			<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
		</DoubleAnimationUsingKeyFrames>
	</Storyboard>
	

	<DataTemplate x:Key="GroupHeaderTemplate">
		<ContentPresenter Content="{Binding Header}" />
	</DataTemplate>
	
	<ControlTemplate x:Key="GridViewGroupToggleButtonTemplate" TargetType="ToggleButton">
		<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
			<ContentPresenter />
		</Border>
	</ControlTemplate>	
	<Style x:Key="GridViewGroupToggleButtonStyle" TargetType="ToggleButton">
		<Setter Property="Template" Value="{StaticResource GridViewGroupToggleButtonTemplate}" />
		<Setter Property="HorizontalContentAlignment" Value="Left" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Padding" Value="9,0,0,0" />
	</Style>

	<ControlTemplate x:Key="GridViewGroupRowTemplate" TargetType="grid:GridViewGroupRow">
		<Grid x:Name="PART_GroupExpanderGrid">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition x:Name="PART_HeaderRow" MinHeight="{TemplateBinding MinHeight}" />
				<RowDefinition x:Name="ContentRow" Height="Auto" />
			</Grid.RowDefinitions>

			

			<Border x:Name="ToggleButtonBorder" Background="{TemplateBinding Background}" Grid.Column="2" Grid.ColumnSpan="2" MinHeight="{TemplateBinding MinHeight}" grid:SelectiveScrollingGrid.SelectiveScrollingClip="True">
				<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="25" />
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="*" />
						</Grid.ColumnDefinitions>

						<!--Aggregates-->
						<Border grid:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="{Binding ShowHeaderAggregates, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="2">
							<grid:AggregateResultsList ItemsSource="{TemplateBinding AggregateResults}"  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
								<grid:AggregateResultsList.ItemTemplate>
									<DataTemplate>
										<grid:GridViewAggregateResultCell AggregateResult="{Binding}" telerik:StyleManager.Theme="{StaticResource Theme}" />
									</DataTemplate>
								</grid:AggregateResultsList.ItemTemplate>
								<grid:AggregateResultsList.ItemsPanel>
									<ItemsPanelTemplate>
										<StackPanel Orientation="Horizontal" />
									</ItemsPanelTemplate>
								</grid:AggregateResultsList.ItemsPanel>
							</grid:AggregateResultsList>
						</Border>

						<!--Icon-->
						<Border x:Name="IconOuterBorder" BorderBrush="{StaticResource ControlOuterBorder}" Background="Transparent" BorderThickness="0,0,0,1" HorizontalAlignment="Stretch" grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
							
							<Path x:Name="ExpanderButton" Grid.Column="0"
									HorizontalAlignment="Center" 									
									VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
									Fill="{StaticResource GridView_GroupRowIndicator}"
									Width="8" Height="4"
									Data="M0,0 L2,0 L4,2.0000002 L6,2.3841858E-07 L8,2.3841858E-07 L5,3.0000002 L4,4 z"
									RenderTransformOrigin="0.5,0.5">
							<Path.RenderTransform>
								<RotateTransform />
							</Path.RenderTransform>
						</Path>
							
						</Border>

						<!--ToggleButton-->
						<ToggleButton x:Name="HeaderButton" Grid.Column="0" Grid.ColumnSpan="3"
									  Background="{TemplateBinding Background}" grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
									  IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" 
									  Opacity="0" IsTabStop="{TemplateBinding IsTabStop}"/>
						
						<!--GroupHeader-->
						<ToggleButton Grid.Column="1" Padding="0,0,10,0"
									  grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" 
									  Background="Transparent" BorderThickness="0" BorderBrush="{x:Null}" 
									  Style="{StaticResource GridViewGroupToggleButtonStyle}" Foreground="{TemplateBinding Foreground}"
									  IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" IsTabStop="{TemplateBinding IsTabStop}">						
							<ContentPresenter Grid.Column="1" Margin="0,0,10,0" Content="{TemplateBinding GroupViewModel}" VerticalAlignment="Center" ContentTemplate="{TemplateBinding GroupHeaderTemplate}" />
						</ToggleButton>

					<Border grid:SelectiveScrollingGrid.SelectiveScrollingClip="True" BorderBrush="{StaticResource ControlOuterBorder}" BorderThickness="0,0,0,1" Grid.Column="1" Grid.ColumnSpan="2" />
						
					</Grid>
			</Border>

			<!--Indicator-->
			<Border x:Name="PART_IndicatorPresenter"
						Width="25"
						VerticalAlignment="Stretch"
						Grid.Column="0"
						Visibility="{TemplateBinding RowIndicatorVisibility}"
						grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
						Grid.RowSpan="3"
						Background="{StaticResource GridView_RowIndicatorCellBackground}"
						BorderBrush="{StaticResource ControlOuterBorder}"
						BorderThickness="0,0,1,1" />

			<!--Indent-->
			<grid:IndentPresenter grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" 
								  IndentLevel="{TemplateBinding Level}" Background="{TemplateBinding Background}"
								  Grid.Column="1" 
								  telerik:StyleManager.Theme="{StaticResource Theme}" />

			<!--Content-->
			<Border x:Name="Content" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5" Visibility="Collapsed" >	
				<StackPanel>
					<grid:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel" />
					<grid:GridViewGroupFooterRow x:Name="Footer" telerik:StyleManager.Theme="{StaticResource Theme}" />
				</StackPanel>
			</Border>

			<Border x:Name="BottomBorder" Grid.Column="2" Grid.Row="1" BorderThickness="0,0,0,1" BorderBrush="{StaticResource ControlOuterBorder}" VerticalAlignment="Bottom" Visibility="Collapsed" />
		</Grid>
	 
		
		<ControlTemplate.Triggers>
			<Trigger Property="IsExpanded" Value="True">
				<Setter Property="Visibility" TargetName="BottomBorder" Value="Visible" />
				<Setter Property="Visibility" TargetName="Content" Value="Visible" />
				<Setter Property="BorderThickness" TargetName="IconOuterBorder" Value="0,0,0,0" />
				<Trigger.EnterActions>
					<BeginStoryboard Storyboard="{StaticResource Expand}" />
				</Trigger.EnterActions>
				<Trigger.ExitActions>
					<BeginStoryboard Storyboard="{StaticResource Collapse}" />
				</Trigger.ExitActions>
			</Trigger>
		</ControlTemplate.Triggers>
		
	</ControlTemplate>

	<Style 
		
		x:Key="{telerik:ThemeResourceKey ThemeType=telerik:ExpressionDarkTheme, ElementType=grid:GridViewGroupRow}"
		
		TargetType="grid:GridViewGroupRow">
		<Setter Property="Template" Value="{StaticResource GridViewGroupRowTemplate}" />
		<Setter Property="GroupHeaderTemplate" Value="{StaticResource GroupHeaderTemplate}" />        
		<Setter Property="Background" Value="{StaticResource GridView_GroupRowBackground}" />
		<Setter Property="BorderBrush" Value="{StaticResource GridView_GridLinesItemBorder}" />
		<Setter Property="BorderThickness" Value="0" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="HorizontalContentAlignment" Value="Left" />
		<Setter Property="Padding" Value="10,0,0,0" />
		<Setter Property="MinHeight" Value="25" />
		
		<Setter Property="SnapsToDevicePixels" Value="True" />
		
	</Style>
	
	
</ResourceDictionary>