<!-- **************************************************************************

  Copyright (c) 2010 CubeSoft, Inc.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as published
  by the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.

*************************************************************************** -->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- **********************************************************************
      Import
    *********************************************************************** -->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Themes/GenericDialog.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- **********************************************************************
      GridViewColumnHeader
    *********************************************************************** -->
    <ControlTemplate x:Key="ColumnHeaderTemplate" TargetType="{x:Type GridViewColumnHeader}">
        <Border
            Padding="8,2"
            Margin="0,0,0,2"
            BorderThickness="0,0,1,0"
            BorderBrush="{StaticResource LightBorderBrush}">
            <TextBlock Text="{TemplateBinding Content}" />
        </Border>
    </ControlTemplate>

    <Style TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="IsEnabled" Value="False" />
        <Setter Property="Foreground" Value="{StaticResource WindowForegroundBrush}" />
        <Setter Property="Template" Value="{StaticResource ColumnHeaderTemplate}" />
    </Style>

    <!-- **********************************************************************
      PrimaryTextStyle
    *********************************************************************** -->
    <Style x:Key="PrimaryTextStyle" TargetType="{x:Type TextBlock}">
        <Setter Property="Margin" Value="6,0,0,0" />
        <Setter Property="TextTrimming" Value="WordEllipsis" />
    </Style>

    <!-- **********************************************************************
      SecondaryTextStyle
    *********************************************************************** -->
    <Style x:Key="SecondaryTextStyle" TargetType="{x:Type TextBlock}">
        <Setter Property="Foreground" Value="Gray" />
        <Setter Property="TextTrimming" Value="WordEllipsis" />
    </Style>

    <!-- **********************************************************************
      InsertPositionStyle
    *********************************************************************** -->
    <Style x:Key="InsertPositionStyle" TargetType="{x:Type TextBox}">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="TextAlignment" Value="Right" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="Width" Value="50" />
        <Setter Property="Margin" Value="0,0,4,0" />
    </Style>

    <!-- **********************************************************************
      InsertItemTemplate
    *********************************************************************** -->
    <ControlTemplate x:Key="InsertItemTemplate" TargetType="{x:Type ListViewItem}">
        <Border
            x:Name="PART_Border"
            BorderBrush="Transparent"
            BorderThickness="1"
            Padding="0,3"
            Background="{TemplateBinding Background}">
            <GridViewRowPresenter
                HorizontalAlignment="Stretch"
                Width="Auto"
                Margin="0"
                Content="{TemplateBinding Content}" />
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" TargetName="PART_Border" Value="{StaticResource HighlightBackgroundBrush}" />
                <Setter Property="BorderBrush" TargetName="PART_Border" Value="{StaticResource HighlightBorderBrush}" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" TargetName="PART_Border" Value="{StaticResource HighlightBackgroundBrush}" />
                <Setter Property="BorderBrush" TargetName="PART_Border" Value="{StaticResource HighlightBorderBrush}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- **********************************************************************
      InsertItemStyle
    *********************************************************************** -->
    <Style x:Key="InsertItemStyle" TargetType="{x:Type ListViewItem}">
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=OneWay}" />
        <Setter Property="Foreground" Value="{StaticResource LightForegroundBrush}" />
        <Setter Property="Template" Value="{StaticResource InsertItemTemplate}" />
    </Style>

    <!-- **********************************************************************
      InsertCollectionStyle
    *********************************************************************** -->
    <Style x:Key="InsertCollectionStyle" TargetType="{x:Type ListView}">
        <Setter Property="Margin" Value="0,0,8,0" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderBrush" Value="{StaticResource LightBorderBrush}" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource InsertItemStyle}" />
    </Style>

    <!-- **********************************************************************
      OperationButtonStyle
    *********************************************************************** -->
    <Style x:Key="OperationButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DialogButtonStyle}">
        <Setter Property="Width" Value="100" />
    </Style>
</ResourceDictionary>