﻿<ResourceDictionary 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d"
                    xmlns:ui="clr-namespace:HMI.UI"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:pw="https://opensource.panuon.com/wpf"
                    xmlns:pu="https://opensource.panuon.com/wpf-ui"
             xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
             xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
        <ResourceDictionary Source="/HMI.UI;component/Style/ScrollBarResource.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="DefaultDataGridColumnHeader" TargetType="DataGridColumnHeader">
        <Setter Property="Background" Value="{DynamicResource PrimaryColor}"/>
        <Setter Property="Foreground" Value="{DynamicResource PrimaryColorContract}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource PrimaryColorContract}"/>
        <Setter Property="BorderThickness" Value="0,0,1,1"/>
    </Style>

    <Style x:Key="DefaultDataGridCell" TargetType="DataGridCell">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="5,0,0,0"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridCell">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="{DynamicResource PrimaryColor}"/>
                <Setter Property="Foreground" Value="{DynamicResource PrimaryColorContract}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="DefaultDataGridRow" TargetType="DataGridRow">
        <Setter Property="Background" Value="White"/>
        <Style.Triggers>
            <Trigger Property="AlternationIndex" Value="1">
                <Setter Property="Background" Value="#eeeeee"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource SecondPrimaryColor}"/>
                <Setter Property="Foreground" Value="{DynamicResource SecondPrimaryColorContract}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="DefaultDataGrid" TargetType="DataGrid">
        <Style.Resources>
            <Style TargetType="ScrollBar" BasedOn="{StaticResource ScrollStyle_Mobile}"/>
        </Style.Resources>
        <Setter Property="CellStyle" Value="{StaticResource DefaultDataGridCell}"/>

        <Setter Property="RowHeight" Value="30"/>
        <Setter Property="ColumnHeaderHeight" Value="36"/>
        <Setter Property="ColumnHeaderStyle" Value="{StaticResource DefaultDataGridColumnHeader}"/>

        <Setter Property="ForceCursor" Value="True"/>
        <Setter Property="SelectionMode" Value="Single"/>
        <Setter Property="RowStyle" Value="{StaticResource DefaultDataGridRow}"/>
        <Setter Property="AlternationCount" Value="2"/>
        <Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource TableBoarder}"/>
        <Setter Property="VerticalGridLinesBrush" Value="{DynamicResource TableBoarder}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource TableBoarder}" />
        <Setter Property="AutoGenerateColumns" Value="False"/>
        <Setter Property="CanUserAddRows" Value="False"/>
        <Setter Property="CanUserSortColumns" Value="False"/>
        <Setter Property="CanUserDeleteRows" Value="False"/>
        <Setter Property="RowHeaderWidth" Value="1"/>
        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="GridLinesVisibility" Value="All"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{DynamicResource CommonBoarder}"/>
        <Setter Property="FontSize" Value="{DynamicResource ContentFontSize2}"/>
    </Style>
</ResourceDictionary>