<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:common="clr-namespace:Com.FirmLib.UI.Common"
                    xmlns:local="http://schemas.FWind/xaml">
    <Style x:Key="{x:Static common:CommonStyles.TextBoxKey}"  TargetType="{x:Type TextBox}" BasedOn="{StaticResource ResourceKey={x:Static local:ResourceKeys.ErrorTemplateKey2}}">
        <Setter Property="BorderThickness" Value="1"></Setter>
        <Setter Property="BorderBrush" Value="Black"></Setter>
    </Style>
    <Style x:Key="{x:Static common:CommonStyles.StarLableKey}"  TargetType="{x:Type Label}">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="*" Foreground="Red" Margin="5,2,2,2" VerticalAlignment="Center"></TextBlock>
                        <ContentPresenter Grid.Column="1"  Content="{Binding}"></ContentPresenter>
                    </Grid>
                </DataTemplate>
            </Setter.Value>

        </Setter>
    </Style>
    <Style x:Key="{x:Static common:CommonStyles.ButtonKey}"  TargetType="{x:Type Button}">
        <Setter Property="BorderThickness" Value="1"></Setter>
        <Setter Property="BorderBrush" Value="Black"></Setter>
        <Setter Property="Background" Value="White"></Setter>
        <Setter Property="Opacity" Value="1"></Setter>
        <Setter Property="Padding" Value="5,0,5,0"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border  Name="Border" BorderThickness="{TemplateBinding Button.BorderThickness}" BorderBrush="{TemplateBinding Button.BorderBrush}" Background="{TemplateBinding Button.Background}" >
                        <Grid Margin="{TemplateBinding Padding}" HorizontalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Image x:Name="PART_Image" Source="{Binding Path=(local:ButtonOptions.Icon),RelativeSource={RelativeSource TemplatedParent}}" Width="{TemplateBinding Button.ActualHeight}" Stretch="Uniform" ></Image>
                            <ContentPresenter Grid.Column="1" Content="{TemplateBinding ContentControl.Content}" VerticalAlignment="Center" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"></ContentPresenter>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="local:ButtonOptions.Icon" Value="{x:Null}">
                            <Setter TargetName="PART_Image" Property="Visibility" Value="Collapsed"></Setter>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" Value="#FFCBC6C6"/>
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard TargetName="Border">
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:1" />
                                    </Storyboard>
                                </BeginStoryboard>

                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard TargetName="Border">
                                        <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:1" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Button.Foreground" TargetName="Border"  Value="Gray" />
                            <!--<Setter Property="BorderThickness" TargetName="Border" Value="0,0,0,0" />-->
                        </Trigger>
                    </ControlTemplate.Triggers>
                 
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{x:Static common:CommonStyles.GroupBoxKey}"  TargetType="{x:Type GroupBox}">
        <Setter Property="BorderThickness" Value="0,1,0,0"></Setter>
        <Setter Property="BorderBrush" Value="Black"></Setter>
    </Style>
    <Style x:Key="{x:Static common:CommonStyles.LinkButtonKey}"  TargetType="{x:Type Button}">
        <Setter Property="Foreground" Value="Blue"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate  TargetType="Button">
                    <Border  VerticalAlignment="Center" BorderBrush="{TemplateBinding Button.Foreground}"  HorizontalAlignment="Center" BorderThickness="0,0,0,0" Name="border" Padding="2">
                        <TextBlock TextDecorations="Underline">  
                            <ContentPresenter />
                        </TextBlock>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Button.Foreground" TargetName="border"  Value="Gray" />
                            <Setter Property="BorderThickness" TargetName="border" Value="0,0,0,0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger   Property="IsMouseOver"  Value="true">
                <Setter   Property="Foreground"  
                    Value="#FF834A4A" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="{x:Static common:CommonStyles.ComboBoxKey}"  TargetType="{x:Type ComboBox}">
        <Setter Property="BorderThickness" Value="1"></Setter>
        <Setter Property="BorderBrush" Value="Black"></Setter>
        <Setter Property="Background" Value="White"></Setter>
        <!--<Setter Property="SelectionBoxItemTemplate">
          <Setter.Value>
              <DataTemplate>
                  <Border BorderThickness="1" BorderBrush="Black">
                      <ContentPresenter Content="{Binding}"></ContentPresenter>
                    </Border>
                 
              </DataTemplate>
            </Setter.Value>
        </Setter>-->
    </Style>

    <Style  x:Key="{x:Static common:CommonStyles.DataGridCellKey}" TargetType="DataGridCell">
        <Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
        <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
        <Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
        <Setter Property="VerticalAlignment" Value="Stretch"></Setter>
        <Setter Property="BorderThickness" Value="0">
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="SkyBlue"></Setter>
                <Setter Property="Foreground" Value="White"></Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="{x:Static common:CommonStyles.ControlKey}"  TargetType="{x:Type Control}">
        <Setter Property="BorderThickness" Value="1"></Setter>
        <Setter Property="BorderBrush" Value="Black"></Setter>
        <Setter Property="Background" Value="White"></Setter>
   
    </Style>
</ResourceDictionary>