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

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Colors.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--  Button style -->
    <Style TargetType="{x:Type Button}" x:Key="WindowButtonStyle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ButtonBase}">
                    <Border
                            x:Name="Chrome"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Margin="0"
                            Background="{TemplateBinding Background}"
                            SnapsToDevicePixels="True">
                        <ContentPresenter
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                Content="{TemplateBinding Content}"
                                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                Margin="{TemplateBinding Padding}"
                                RecognizesAccessKey="True"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="FontFamily" Value="Webdings"/>
        <Setter Property="FontSize" Value="13.333" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Margin" Value="0,2,3,0"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="Gray" />
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style TargetType="{x:Type catel:DataWindow}" x:Key="StandardDialogWindow">
        <Setter Property="WindowStyle" Value="None" />
        <Setter Property="ResizeMode" Value="NoResize" />
        <Setter Property="ShowInTaskbar" Value="False" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="SizeToContent" Value="Height" />
        <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type catel:DataWindow}">
                    <Grid>
                        <Border Background="{TemplateBinding Background}" 
                                BorderBrush="{StaticResource WindowsBorder}" 
                                BorderThickness="1">
                            <Grid x:Name="LayoutRoot" Margin="5" IsEnabled="{Binding BusyIndicator.IsEnabled}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <TextBlock Foreground="{DynamicResource Accent_Color}" x:Name="PART_TITLEBAR" VerticalAlignment="Top" Text="{TemplateBinding Title}" FontSize="21" Margin="5,0" />
                                <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="PART_CLOSE" Height="18" Width="18" Cursor="Hand" Content="r" Foreground="#FF919191" ToolTip="{catel:LanguageBinding Close}" Style="{DynamicResource WindowButtonStyle}" Command="{Binding Close_Command}" IsCancel="True" />

                                <Grid Background="{TemplateBinding Background}" Grid.Row="1" Margin="5">
                                    <AdornerDecorator>
                                        <ContentPresenter Content="{TemplateBinding catel:DataWindow.Content}" 
                                                          Margin="{TemplateBinding Margin}" 
                                                          DataContext="{TemplateBinding DataContext}" 
                                                          ContextMenu="{TemplateBinding ContextMenu}"/>
                                    </AdornerDecorator>

                                </Grid>

                                <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5,0">
                                    <Button Content="{catel:LanguageBinding Ok}" Height="30" Width="125"  Margin="0,0,2,0" Command="{Binding Submit_Command}" CommandParameter="{Binding Item}" />
                                    <Button Content="{catel:LanguageBinding Cancel}" Height="30" Width="125" Margin="2,0,0,0" Command="{Binding Close_Command}"/>
                                </StackPanel>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type catel:DataWindow}" x:Key="StandardDialogWindowWithoutButtons">
        <Setter Property="WindowStyle" Value="None" />
        <Setter Property="ResizeMode" Value="NoResize" />
        <Setter Property="ShowInTaskbar" Value="False" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="SizeToContent" Value="Height" />
        <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type catel:DataWindow}">
                    <Grid>
                        <Border Background="{TemplateBinding Background}" 
                                BorderBrush="{StaticResource WindowsBorder}" 
                                BorderThickness="1">
                            <Grid x:Name="LayoutRoot" Margin="5"  IsEnabled="{Binding BusyIndicator.IsEnabled}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <TextBlock Foreground="{DynamicResource Accent_Color}" x:Name="PART_TITLEBAR" VerticalAlignment="Top" Text="{TemplateBinding Title}" FontSize="21" Margin="5,0" />
                                <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="PART_CLOSE" Height="18" Width="18" Cursor="Hand" Content="r" Foreground="#FF919191"  ToolTip="{catel:LanguageBinding Close}" Style="{DynamicResource WindowButtonStyle}" Command="{Binding Close_Command}" IsCancel="True" />

                                <Grid Background="{TemplateBinding Background}" Grid.Row="1" Margin="5">
                                    <AdornerDecorator>
                                        <ContentPresenter Content="{TemplateBinding catel:DataWindow.Content}" 
                                                          Margin="{TemplateBinding Margin}" 
                                                          DataContext="{TemplateBinding DataContext}" 
                                                          ContextMenu="{TemplateBinding ContextMenu}"/>
                                    </AdornerDecorator>

                                </Grid>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>