<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:hc="clr-namespace:HandyControl.Controls">

    <Style x:Key="CoverViewItemBaseStyle" TargetType="hc:CoverViewItem">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:CoverViewItem">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentPresenter ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" Margin="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CoverViewContentBaseStyle" TargetType="hc:CoverViewContent">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
        <Setter Property="Margin" Value="0,0,0,8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:CoverViewContent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="16"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Border x:Name="PART_Triangle" Visibility="Visible" Grid.Row="0" Width="30" Height="30" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.RowSpan="2">
                            <Border.RenderTransform>
                                <TransformGroup>
                                    <TranslateTransform X="5" Y="5"/>
                                    <RotateTransform Angle="45"/>
                                </TransformGroup>
                            </Border.RenderTransform>
                        </Border>
                        <Border x:Name="PART_Content" MinHeight="30" Height="0" Grid.Row="1" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                            <ContentPresenter Margin="{TemplateBinding Padding}"/>
                        </Border>
                        <Rectangle SnapsToDevicePixels="True" Visibility="{Binding Visibility,ElementName=PART_Triangle}" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="28" Margin="{Binding Margin,ElementName=PART_Triangle}" Height="1" Fill="{TemplateBinding Background}">
                            <Rectangle.RenderTransform>
                                <TransformGroup>
                                    <TranslateTransform X="1"/>
                                </TransformGroup>
                            </Rectangle.RenderTransform>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CoverViewBaseStyle" TargetType="hc:CoverView">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource CoverViewItemBaseStyle}"/>
        <Setter Property="CoverViewContentStyle" Value="{StaticResource CoverViewContentBaseStyle}"/>
        <Setter Property="ItemMargin" Value="8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:CoverView">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                        <WrapPanel x:Name="PART_Panel"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
