alielie
2025-07-04 0940f31b7eba1cf6b6a8c1fca72d97cf686e79f2
HMI.UI/Style/PanuonResource.xaml
@@ -8,16 +8,13 @@
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:pw="https://opensource.panuon.com/wpf"
                    xmlns:pu="https://opensource.panuon.com/wpf-ui"
             xmlns:hc="clr-namespace:HMI.Core;assembly=HMI.Core"
             xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
             xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI">
    <ResourceDictionary.MergedDictionaries>
        <pu:StyleDictionary Includes="PasswordBox,TextBox,ComboBox,Button,TreeView,Menu,ListBox,ContextMenu" />
        <ResourceDictionary Source="/HMI.UI;component/Style/Colors.xaml"/>
        <pu:StyleDictionary Includes="PasswordBox,TextBox,ComboBox,Button,DataGrid,TreeView,Menu" />
        <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <hc:LangConverter x:Key="lc"/>
    <sys:Double x:Key="TitleFontSize">20</sys:Double>
    <sys:Double x:Key="ContentFontSize">16</sys:Double>
    <sys:Double x:Key="ContentFontSize2">14</sys:Double>
@@ -30,6 +27,7 @@
        <Setter Property="Padding" Value="8"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Focusable" Value="False"/>
    </Style>
    <Style x:Key="CommonButton" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
@@ -57,7 +55,7 @@
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe643;"/>
        <Setter Property="Content" Value="{DynamicResource App.Edit}"/>
    </Style>
    <Style x:Key="RfhBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe631;"/>
        <Setter Property="Content" Value="{DynamicResource App.Refresh}"/>
@@ -158,78 +156,16 @@
    <Style x:Key="CardBoarder" TargetType="Border">
        <Setter Property="BorderBrush" Value="{StaticResource CommonBoarder}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Background" Value="#FFF"/>
        <Setter Property="Margin" Value="10"/>
        <Setter Property="Background" Value="#f3f9ff"/>
        <Setter Property="Margin" Value="5"/>
        <Setter Property="Padding" Value="10"/>
    </Style>
    <Style x:Key="DefaultDataGridRow" TargetType="DataGridRow" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridRowStyle}}">
        <Setter Property="Background" Value="White"/>
        <Style.Triggers>
            <Trigger Property="AlternationIndex" Value="1">
                <Setter Property="Background" Value="#eeeeee"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="DefaultDataGrid" TargetType="DataGrid" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridStyle}}">
        <Style.Resources>
            <Style TargetType="DataGridCell"
                   BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridCellStyle}}">
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Padding" Value="5"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="VerticalAlignment" Value="Stretch"/>
                <Setter Property="Background" Value="Transparent"/>
            </Style>
            <!--<Style TargetType="TextBlock">
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="Padding" Value="5"/>
            </Style>-->
            <Style TargetType="DataGridColumnHeader"
       BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridColumnHeaderStyle}}">
                <Setter Property="Padding" Value="10"/>
                <Setter Property="BorderThickness" Value="0"/>
            </Style>
        </Style.Resources>
        <Setter Property="pu:DataGridHelper.ColumnHeaderPadding" Value="0"/>
        <Setter Property="RowHeight" Value="30"/>
        <Setter Property="ColumnHeaderHeight" Value="36"/>
        <Setter Property="ForceCursor" Value="True"/>
        <Setter Property="SelectionMode" Value="Single"/>
        <Setter Property="RowStyle" Value="{StaticResource DefaultDataGridRow}"/>
        <Setter Property="AlternationCount" Value="2"></Setter>
        <Setter Property="Foreground" Value="#3a3a3a"/>
        <Setter Property="HorizontalGridLinesBrush" Value="{StaticResource TableBoarder}"/>
        <Setter Property="VerticalGridLinesBrush" Value="{StaticResource TableBoarder}"/>
        <Setter Property="BorderBrush" Value="{StaticResource 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="{StaticResource CommonBoarder}"/>
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize2}"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderForeground" Value="White"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderBackground" Value="{StaticResource TableHeader}"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderHoverBackground" Value="{StaticResource TableHeader}"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderSeparatorBrush" Value="{StaticResource TableBoarder}"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderSeparatorVisibility" Value="Visible"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderVerticalContentAlignment" Value="Center"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderHorizontalContentAlignment" Value="Left"/>
        <Setter Property="pu:DataGridHelper.RowHeaderSeparatorBrush" Value="{StaticResource CommonBoarder}"/>
        <Setter Property="pu:DataGridHelper.RowHoverForeground" Value="{StaticResource SecondPrimaryColorContract}"/>
        <Setter Property="pu:DataGridHelper.RowHoverBackground" Value="{StaticResource SecondPrimaryColor}"/>
        <Setter Property="pu:DataGridHelper.RowSelectedBackground" Value="{StaticResource PrimaryColor}"/>
        <Setter Property="pu:DataGridHelper.RowSelectedForeground" Value="White"/>
        <Setter Property="pu:DataGridHelper.RowHeaderBorderThickness" Value="10,0,0,0"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderBorderThickness" Value="0"/>
        <Setter Property="pu:DataGridHelper.ColumnHeaderPadding" Value="0"/>
    <Style x:Key="TableTextBlock" TargetType="TextBlock">
        <Setter Property="Padding" Value="0,2"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
    </Style>
    <Style x:Key="DefaultTreeView" TargetType="TreeView" BasedOn="{StaticResource {x:Static pu:StyleKeys.TreeViewStyle}}">
@@ -281,9 +217,21 @@
        <Setter Property="pu:WindowXCaption.Buttons" Value="Close"/>
        <Setter Property="pu:WindowXModalDialog.Buttons" Value="OKCancel"/>
        <Setter Property="pu:WindowXModalDialog.CancelButtonContent" 
                Value="{Binding Converter={StaticResource lc},ConverterParameter='App.Cancel'}"/>
                Value="{DynamicResource App.Cancel}"/>
        <Setter Property="pu:WindowXModalDialog.OKButtonContent" 
                Value="{Binding Converter={StaticResource lc},ConverterParameter='App.Save'}"/>
                Value="{DynamicResource App.Save}"/>
        <Setter Property="pu:WindowXModalDialog.ButtonPanelMargin" Value="0,30,10,10"/>
    </Style>
    <Style x:Key="DefaultListBox" TargetType="ListBox" BasedOn="{StaticResource {x:Static pu:StyleKeys.ListBoxStyle}}">
        <Setter Property="pu:ListBoxHelper.ItemsHoverBackground" Value="{StaticResource SecondPrimaryColor}"/>
        <Setter Property="pu:ListBoxHelper.ItemsHoverForeground" Value="{StaticResource SecondPrimaryColorContract}"/>
        <Setter Property="pu:ListBoxHelper.ItemsSelectedBackground" Value="{StaticResource PrimaryColor}"/>
        <Setter Property="pu:ListBoxHelper.ItemsSelectedForeground" Value="{StaticResource PrimaryColorContract}"/>
        <Setter Property="pu:ListBoxHelper.ItemsMargin" Value="0"/>
        <Setter Property="pu:ListBoxHelper.ItemsPadding" Value="7,5,7,5"/>
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
    </Style>
</ResourceDictionary>