	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1tv="clr-namespace:C1.WPF.TileView" xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1ScrollBar.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************* C1TileView *******************-->
    
    <!-- Brush @ TileView -->
    <SolidColorBrush x:Key="TileViewBackgroundBrush" Color="{StaticResource BaseColor}" />

    <!-- Brush @ TileViewItem background -->
    <SolidColorBrush x:Key="TileViewItemBackground" Color="White" />

    <!-- CornerRadius @ TileViewItem -->
    <CornerRadius x:Key="TileViewItemCornerRadius">0</CornerRadius>
    <!-- CornerRadius @ TileViewItem Header -->
    <CornerRadius x:Key="TileViewItemHeaderCornerRadius">0</CornerRadius>

    <!-- Button @ TileViewItem -->
    <Style x:Key="TileViewItemStateButton" TargetType="Button">        
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Padding" Value="2" />
        <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 Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" Background="{TemplateBinding c1:ClearStyleExtensions.ButtonBackground}" />
                        <Border x:Name="MouseOverElement" Background="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" Visibility="Collapsed" />
                        <Border x:Name="PressedElement" Background="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" Visibility="Collapsed" />
                        <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Rectangle x:Name="DisabledVisualElement" Fill="{StaticResource DisabledBrush}" IsHitTestVisible="false" Opacity="0" />
                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Stroke="{TemplateBinding c1:ClearStyleExtensions.FocusBrush}" StrokeThickness="1" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1TileView -->
    <Style TargetType="c1tv:C1TileView">
        
        
        <Setter Property="Background" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource WpfInputMouseOverBrush}" />
        <Setter Property="PressedBrush" Value="{StaticResource WpfInputSelectedBackground}" />
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="ButtonBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="HeaderBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="FocusBrush" Value="{StaticResource WpfInputFocusBrush}" />        
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />        
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="ButtonForeground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="ItemBackground" Value="{StaticResource TileViewItemBackground}" />
        <Setter Property="ItemForeground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="HeaderForeground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="ScrollBarStyle" Value="{StaticResource ScrollBarClearStyle}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1tv:C1TileView">
                	<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                    	<ItemsPresenter />
					</Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <c1tv:C1TileViewPanel />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1TileViewItem -->
    <Style TargetType="c1tv:C1TileViewItem">
        <Setter Property="HeaderPadding" Value="5" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="Margin" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1tv:C1TileViewItem">
                    <Border Margin="{TemplateBinding Margin}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource TileViewItemCornerRadius}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="TiledStates">
                                <VisualState x:Name="Tiled" />
                                <VisualState x:Name="Maximized">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Minimize" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Maximize" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Minimized" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <c1:C1BrushBuilder x:Name="HeaderBackgroundBrush" Input="{TemplateBinding HeaderBackground}" DesignBrush="{StaticResource GeneralGradientBrush}" DesignColor="{StaticResource BaseColor}" />
                            <c1:C1BrushBuilder x:Name="HeaderInnerBorderBrush" Input="{TemplateBinding HeaderBackground}" DesignBrush="{StaticResource InnerBorderBrush}" DesignColor="{StaticResource BaseColor}" />
                            <Border x:Name="Header" Background="{Binding Output, ElementName=HeaderBackgroundBrush}" CornerRadius="{StaticResource TileViewItemHeaderCornerRadius}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.ColumnSpan="2" VerticalAlignment="Bottom" Background="{Binding Output, ElementName=HeaderInnerBorderBrush}" Height="1" Margin="0 0 0 1" />
                                    <ContentControl IsTabStop="False" Content="{TemplateBinding Header}" Padding="{TemplateBinding HeaderPadding}" ContentTemplate="{TemplateBinding HeaderTemplate}" FontFamily="{TemplateBinding HeaderFontFamily}" FontSize="{TemplateBinding HeaderFontSize}" FontStretch="{TemplateBinding HeaderFontStretch}" FontStyle="{TemplateBinding HeaderFontStyle}" FontWeight="{TemplateBinding HeaderFontWeight}" Foreground="{TemplateBinding HeaderForeground}" HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}" VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}" />
                                    <Button x:Name="StateButton" Grid.Column="1" Margin="5 0" VerticalAlignment="Center" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" c1:ClearStyleExtensions.ButtonBackground="{TemplateBinding c1:ClearStyleExtensions.ButtonBackground}" Style="{StaticResource TileViewItemStateButton}" Width="20" Height="20">
                                        <Grid>
                                            <Path x:Name="Minimize" Data="M12.535756,6.0500488 L13.95,7.4642963 L7.4143162,13.999998 L8.0000839,13.999998 L12.00017,14 L12.00017,16.00005 L4,16.00005 L4,14 L4,7.9998541 L6.0000429,7.9998541 L6.0000429,10.999926 L6.0000424,12.58578 z M2,2 L2,18 L18,18 L18,2 z M0,0 L2,0 L20,0 L20,0.99999952 L20,2 L20,19 L19.999998,20 L2,20 L0.99999952,20 L0,20 z" Stretch="Fill" Fill="{TemplateBinding c1:ClearStyleExtensions.ButtonForeground}" Visibility="Collapsed" />
                                            <Path x:Name="Maximize" Data="M0,3.9124217 L2,3.9124217 L9,3.9124217 L9,5.9123688 L2,5.9123688 L2,17.912052 L14,17.912052 L14,10.912236 L16,10.912236 L16,19.911997 L15.000001,19.911997 L14.000001,19.911997 L2,19.911997 L0,19.911999 z M11.99983,0 L20,0 L20,1.9999967 L20,7.9999838 L17.999958,7.9999838 L17.999958,4.9999914 L17.999958,3.4141784 L11.464244,9.9497375 L10.05,8.5355272 L16.585684,1.9999986 L15.999916,1.9999986 L11.99983,1.9999967 z" Stretch="Fill" Fill="{TemplateBinding c1:ClearStyleExtensions.ButtonForeground}" Margin="1" />
                                        </Grid>
                                    </Button>
                                </Grid>
                            </Border>
                            <ContentPresenter x:Name="Presenter" Grid.Row="1" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>