alielie
2025-03-18 a061384ba628a09bf4df91f50321ab22c03129aa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<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/Style/Colors.xaml"/>
        <pu:StyleDictionary Includes="PasswordBox,TextBox,ComboBox,Button,DataGrid,TreeView,Menu" />
        <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <sys:Double x:Key="TitleFontSize">20</sys:Double>
    <sys:Double x:Key="ContentFontSize">16</sys:Double>
    <sys:Double x:Key="ContentFontSize2">14</sys:Double>
 
    <Style x:Key="PrimaryButton" TargetType="Button" BasedOn="{StaticResource {x:Static pu:StyleKeys.ButtonStyle}}">
        <Setter Property="Background" Value="{StaticResource VerBar}"/>
        <Setter Property="Foreground" Value="#FFF"/>
        <Setter Property="pu:IconHelper.FontFamily" Value="{StaticResource iconfont}"/>
        <Setter Property="pu:IconHelper.Margin" Value="0,0,10,0"/>
        <Setter Property="Padding" Value="8"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Cursor" Value="Hand"/>
    </Style>
 
    <Style x:Key="CommonButton" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="Background" Value="#FFF"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="BorderBrush" Value="LightGray"/>
    </Style>
 
    <Style x:Key="DangerButton" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="Background" Value="{StaticResource DangerVerBar}"/>
        <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}"/>
    </Style>
 
    <Style x:Key="SuccessButton" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="Background" Value="{StaticResource GreenVerBar}"/>
        <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}"/>
    </Style>
 
    <Style x:Key="AddBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe61a;"/>
        <Setter Property="Content" Value="{DynamicResource App.Add}"/>
    </Style>
 
    <Style x:Key="EditBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <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}"/>
    </Style>
 
    <Style x:Key="QueryBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe752;"/>
        <Setter Property="Content" Value="{DynamicResource App.Query}"/>
    </Style>
 
    <Style x:Key="ExportBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe638;"/>
        <Setter Property="Content" Value="{DynamicResource App.Export}"/>
    </Style>
 
    <Style x:Key="ImportBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe639;"/>
        <Setter Property="Content" Value="{DynamicResource App.Import}"/>
    </Style>
 
    <Style x:Key="SaveBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe60d;"/>
        <Setter Property="Content" Value="{DynamicResource App.Save}"/>
    </Style>
 
    <Style x:Key="ResetBtn" TargetType="Button" BasedOn="{StaticResource RfhBtn}">
        <Setter Property="Content" Value="{DynamicResource App.Reset}"/>
    </Style>
 
    <Style x:Key="SettingBtn" TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe688;"/>
        <Setter Property="Content" Value="{DynamicResource App.Setting}"/>
    </Style>
 
    <Style x:Key="DelBtn" TargetType="Button" BasedOn="{StaticResource DangerButton}">
        <Setter Property="pu:ButtonHelper.Icon" Value="&#xe626;"/>
        <Setter Property="Content" Value="{DynamicResource App.Delete}"/>
    </Style>
 
    <Style x:Key="LinkButton" TargetType="Button" BasedOn="{StaticResource {x:Static pu:StyleKeys.ButtonStyle}}">
        <Setter Property="Background" Value="{x:Null}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Foreground" Value="{StaticResource PrimaryColor}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding}" Padding="0" HorizontalAlignment="Left" VerticalAlignment="Center" TextDecorations="Underline" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style x:Key="DangerLinkButton" TargetType="Button" BasedOn="{StaticResource LinkButton}">
        <Setter Property="Foreground" Value="{StaticResource DangerColor}"/>
    </Style>
 
    <Style x:Key="DeleteLink" TargetType="Button" BasedOn="{StaticResource DangerLinkButton}">
        <Setter Property="Content" Value="{DynamicResource App.Delete}"/>
    </Style>
 
    <Style x:Key="RowLink" TargetType="Button" BasedOn="{StaticResource LinkButton}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsMouseOver,
                RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}" 
         Value="True">
                <Setter Property="Foreground" Value="#FFF"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=IsSelected,
       RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}" 
Value="True">
                <Setter Property="Foreground" Value="#FFF"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
 
    <Style x:Key="EditLink" TargetType="Button" BasedOn="{StaticResource RowLink}">
        <Setter Property="Content" Value="{DynamicResource App.Edit}"/>
    </Style>
 
    <Style x:Key="CommonToggle" TargetType="ToggleButton" BasedOn="{StaticResource {x:Static pu:StyleKeys.ToggleButtonStyle}}">
        <Setter Property="Background" Value="#FFF"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="BorderBrush" Value="LightGray"/>
        <Setter Property="Cursor" Value="Hand"/>
    </Style>
 
    <Style x:Key="CommonMenu" TargetType="Menu" BasedOn="{StaticResource {x:Static pu:StyleKeys.MenuStyle}}">
        <Setter Property="Background" Value="{StaticResource PrimaryColor}"/>
        <Setter Property="Foreground" Value="#FFF"/>
        <Setter Property="pu:IconHelper.FontFamily" Value="{StaticResource iconfont}"/>
        <Setter Property="pu:IconHelper.Margin" Value="0,0,10,0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Cursor" Value="Hand"/>
    </Style>
 
    <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="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>
 
    <Style x:Key="DefaultTreeView" TargetType="TreeView" BasedOn="{StaticResource {x:Static pu:StyleKeys.TreeViewStyle}}">
        <Setter Property="pu:TreeViewHelper.ItemsHoverBackground" Value="{StaticResource SecondPrimaryColor}"/>
        <Setter Property="pu:TreeViewHelper.ItemsHoverForeground" Value="{StaticResource SecondPrimaryColorContract}"/>
        <Setter Property="pu:TreeViewHelper.ItemsSelectedBackground" Value="{StaticResource PrimaryColor}"/>
        <Setter Property="pu:TreeViewHelper.ItemsSelectedForeground" Value="{StaticResource PrimaryColorContract}"/>
        <Setter Property="pu:TreeViewHelper.ItemsMargin" Value="0"/>
        <Setter Property="pu:TreeViewHelper.ItemsPadding" Value="7,5,7,5"/>
        <Setter Property="dp:TreeViewHelper.AutoExpand" Value="True"/>
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
    </Style>
 
    <Style x:Key="DefaultTabControl" TargetType="TabControl">
        <Setter Property="pu:TabControlHelper.ItemsHorizontalHeaderAlignment" Value="Left"/>
        <Setter Property="pu:TabControlHelper.ItemsHoverBackground" Value="{StaticResource SecondPrimaryColor}"/>
        <Setter Property="pu:TabControlHelper.ItemsHoverForeground" Value="{StaticResource SecondPrimaryColorContract}"/>
        <Setter Property="pu:TabControlHelper.ItemsRibbonLineMargin" Value="0,5,0,5"/>
        <Setter Property="pu:TabControlHelper.ItemsRibbonLineThickness" Value="4"/>
        <Setter Property="pu:TabControlHelper.ItemsRibbonLineVisibility" Value="Visible"/>
        <Setter Property="pu:TabControlHelper.ItemsSelectedRibbonLineBrush" Value="{StaticResource PrimaryColor}"/>
        <Setter Property="pu:TabControlHelper.ItemsSelectedRibbonLineThickness" Value="2"/>
    </Style>
 
    <Style x:Key="ButtonGroup" TargetType="StackPanel">
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="dp:StackPanelHelper.ChildSpace" Value="10"/>
    </Style>
 
    <Style x:Key="TitleBox" TargetType="TextBlock">
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="FontSize" Value="{StaticResource TitleFontSize}"/>
    </Style>
 
    <Style x:Key="FormHeader" TargetType="TextBlock">
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize2}"/>
    </Style>
 
    <Style x:Key="ModalWindow" TargetType="pu:WindowX">
        <Setter Property="pu:WindowXCaption.Background" Value="{StaticResource ReHoriBar}"/>
        <Setter Property="pu:WindowXModalDialog.ButtonStyle" Value="{StaticResource ModalButton}"/>
        <Setter Property="pu:WindowXCaption.Foreground" Value="#FFF"/>
        <Setter Property="pu:WindowXCaption.Buttons" Value="Close"/>
        <Setter Property="pu:WindowXModalDialog.Buttons" Value="OKCancel"/>
        <Setter Property="pu:WindowXModalDialog.CancelButtonContent" 
                Value="{DynamicResource App.Cancel}"/>
        <Setter Property="pu:WindowXModalDialog.OKButtonContent" 
                Value="{DynamicResource App.Save}"/>
        <Setter Property="pu:WindowXModalDialog.ButtonPanelMargin" Value="0,30,10,10"/>
    </Style>
 
    <Popup x:Key="testPop" Placement="Relative" StaysOpen="True" Width="1920" Height="1080">
        <Rectangle x:Name="RectMask"
           Fill="Red"
           Opacity="0"
           Visibility="Visible" />
    </Popup>
</ResourceDictionary>