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

    <Style x:Key="InfoIcon" TargetType="{x:Type Rectangle}">
		<Setter Property="Width" Value="12"/>
        <Setter Property="Height" Value="12"/>
        <Setter Property="Fill">
			<Setter.Value>
				<DrawingBrush>
                    <DrawingBrush.Drawing>
                        <DrawingGroup>
                        <DrawingGroup.Children>
                            <GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M4,7.5C4,5.015 6.015,3 8.5,3 10.985,3 13,5.015 13,7.5 13,9.985 10.985,12 8.5,12 6.015,12 4,9.985 4,7.5" />
                            <GeometryDrawing Brush="#FF414141" Geometry="F1M9,6L8,6 8,5 9,5z M9,10L8,10 8,7 9,7z M8.5,4C6.567,4 5,5.567 5,7.5 5,9.433 6.567,11 8.5,11 10.433,11 12,9.433 12,7.5 12,5.567 10.433,4 8.5,4" />
                            <GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M8,6L9,6 9,5 8,5z M8,10L9,10 9,7 8,7z" />
                        </DrawingGroup.Children>
                        </DrawingGroup>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
			</Setter.Value>
		</Setter>				
	</Style>

    <Style x:Key="HoverUnderlineStyle" TargetType="TextBlock">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="TextBlock.TextDecorations" Value="Underline" />
            </Trigger>
        </Style.Triggers>
    </Style>
    

    <Style x:Key='ErrorControl' TargetType='ContentControl'>        
        <Setter Property='Template'>
            <Setter.Value>
                <ControlTemplate TargetType='ContentControl'>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Width="16" Height="16" ToolTip="{Binding ToolTip}" Name="errorIcon" Visibility="Collapsed">
                            <Rectangle.Fill>
                            <DrawingBrush>
                                <DrawingBrush.Drawing>
                                <DrawingGroup>
                                    <DrawingGroup.Children>
                                    <GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
                                    <GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M8,16C3.589,16 0,12.411 0,8 0,3.589 3.589,0 8,0 12.411,0 16,3.589 16,8 16,12.411 12.411,16 8,16" />
                                    <GeometryDrawing Brush="#FFE41400" Geometry="F1M9,10L7,10 7,3 9,3z M9,13L7,13 7,11 9,11z M8,1C4.134,1 1,4.134 1,8 1,11.865 4.134,15 8,15 11.865,15 15,11.865 15,8 15,4.134 11.865,1 8,1" />
                                    <GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M9,11L7,11 7,13 9,13z M9,10L7,10 7,3 9,3z" />
                                    </DrawingGroup.Children>
                                </DrawingGroup>
                                </DrawingBrush.Drawing>
                            </DrawingBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                      
                        <ContentPresenter Grid.Column="1" Name="errorControl" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource self},Path=Tag}" Value="True">
                            <Setter TargetName="errorIcon" Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                    <ControlTemplate.Resources>
                        <Style TargetType="TextBox">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Path=Tag, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}" Value="True">
                                    <Setter Property="Border.BorderBrush" Value="Red" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>                    
                    </ControlTemplate.Resources>                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>    

    
    <Style x:Key="ErrorBorder" TargetType="Control">
        <Style.Triggers>
            <DataTrigger Binding="{Binding HasErrors}" Value="True">
                <Setter Property="Border.BorderBrush" Value="Red"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    
    

    <Style x:Key="HoverUnderlineStyleWithBackground" TargetType="TextBlock">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="TextBlock.TextDecorations" Value="Underline" />
                <Setter Property="TextBlock.Background" Value="LightGray" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="LinkButton" TargetType="Button">
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <TextBlock Style="{DynamicResource HoverUnderlineStyle}" HorizontalAlignment="Left"> <!--TextDecorations="Underline" -->
                        <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Black" />
        
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ContentButton" TargetType="Button">
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <ContentPresenter />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Black" />
        
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
            </Trigger>
        </Style.Triggers>
    </Style>    

    <Style TargetType="ListBoxItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Name="Border"
                            Padding="2"
                            SnapsToDevicePixels="true">
                        <ContentPresenter />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}"/>
                        </Trigger>
                        <Trigger Property="UIElement.IsMouseOver" Value="True">
                            <Setter Property="Panel.Background" TargetName="Border" 
                                    Value="{DynamicResource SelectedRowBackgroundColor}"/>
                            <Setter Property="Border.BorderBrush" TargetName="Border" 
                                    Value="{DynamicResource SelectedRowBackgroundColor}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type DataGridRow}">
        <Style.Resources>
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="{DynamicResource SelectedRowBackgroundColor}" />
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{DynamicResource SelectedRowBackgroundColor}" />
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
            <!--<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Yellow" /> -->
        </Style.Resources>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
                <Setter Property="Foreground" Value="{DynamicResource TextColor}" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
                <Setter Property="Foreground" Value="{DynamicResource TextColor}" />
            </Trigger>
        </Style.Triggers>
    </Style>    

     <Style x:Key="Test" TargetType="{x:Type MenuItem}">
        <Setter Property="Template">
			<Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Grid Background="{TemplateBinding Background}">
                        <TextBlock Title="{TemplateBinding Header}" />
                    </Grid>
                </ControlTemplate>
			</Setter.Value>
		</Setter>				
	</Style>

</ResourceDictionary>
