alielie
2025-11-24 9211ec11c112e18cd99e77f889a01110a70031ce
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
<pu:WindowX x:Class="WPFProject.PanuonWindow"
            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"
            xmlns:local="clr-namespace:WPFProject"
            xmlns:pw="https://opensource.panuon.com/wpf"
            xmlns:pu="https://opensource.panuon.com/wpf-ui"
            xmlns:ctl="clr-namespace:WPFProject.Controls"
            mc:Ignorable="d"
            WindowStartupLocation="CenterOwner"
            WindowState="Maximized"
            x:Name="window"
            BorderBrush="Transparent"
            pu:WindowXCaption.Buttons="None"
            xmlns:sys="clr-namespace:System;assembly=mscorlib"
            xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
            xmlns:hc="clr-namespace:HMI.Core;assembly=HMI.Core"
            Closed="window_Closed"
            Topmost="False"
            pu:WindowXCaption.HeaderAlignment="Stretch"
            Title="TestPlatform"
            pu:WindowXCaption.Background="Transparent"
            pu:WindowXCaption.Height="80"
            IsOverlayerVisible="True"
            pu:WindowXCaption.Foreground="#FFF">
    <Window.Resources>
        <hc:LangConverter x:Key="lc"/>
        <Style x:Key="UserMenu" 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"/>
            <Setter Property="pu:MenuHelper.SubmenuItemsForeground" Value="#3a3a3a"/>
            <Setter Property="pu:MenuHelper.SubmenuItemsBackground" Value="White"/>
            <Setter Property="pu:MenuHelper.TopLevelItemsHoverBackground" Value="{x:Null}"/>
            <Setter Property="pu:MenuHelper.TopLevelDropDownPlacement" Value="BottomLeft"/>
        </Style>
 
    </Window.Resources>
    <Window.Background>
        <ImageBrush Stretch="Uniform" AlignmentX="Left" AlignmentY="Top"  
                    ImageSource="/Resources/Background.png"/>
    </Window.Background>
 
    <pu:WindowXCaption.HeaderTemplate>
        <DataTemplate>
            <DockPanel DataContext="{Binding ElementName=window}" WindowChrome.IsHitTestVisibleInChrome="True"
                        VerticalAlignment="Center" Height="100">
                <StackPanel Orientation="Horizontal">
                    <Image DockPanel.Dock="Left" Source="{Binding WindowLogo}" Margin="5,0,20,0" Height="60" VerticalAlignment="Center" Stretch="Fill"
  RenderOptions.BitmapScalingMode="HighQuality" />
                    <TextBlock FontSize="30" VerticalAlignment="Center" Text="{Binding WindowTitle}">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="8"
 Direction="330"
 Color="Black"
 Opacity="0.5"
BlurRadius="4"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </StackPanel>
 
                <StackPanel DockPanel.Dock="Right" VerticalAlignment="Top" Margin="10,10,0,0" Orientation="Horizontal">
                    <Menu Margin="0" Padding="0" VerticalAlignment="Top"
  VerticalContentAlignment="Center" Style="{StaticResource UserMenu}"
  
  Background="Transparent">
                        <MenuItem x:Name="userMenu" Header="{Binding WelcomeTitle}" FontSize="16">
                            <MenuItem Icon="&#xe61d;" Cursor="Hand" FontSize="14" Header="退出登录" 
                                      x:Name="MiLogout" Click="MenuItem_Click"/>
                            <MenuItem Cursor="Hand" FontSize="14" Icon="&#xe867;"
              Header="重新启动"
              x:Name="MiRestart"
              Click="MenuItem_Click"/>
                        </MenuItem>
                    </Menu>
 
                    <Button x:Name="BtnSwitchTheme"
FontSize="18"
FontFamily="/HMI.UI;component/Resources/Font/#iconfont"
Content="&#xe60e;"
RenderTransformOrigin="0.5,0.5"
Click="Button_Click">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXCaption.MinimizeButtonStyleKey}}">
                                <Setter Property="Focusable" Value="False"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ShowMenu}" Value="True">
                                        <Setter Property="Button.RenderTransform">
                                            <Setter.Value>
                                                <RotateTransform x:Name="MyAnimatedTransform" Angle="180" />
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                    </Button>
 
                    <Button FontSize="18" Click="Button_Click" x:Name="minBtn">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXCaption.MinimizeButtonStyleKey}}">
                                <Setter Property="Focusable" Value="False"/>
                                <Setter Property="IsHitTestVisible" Value="True"/>
                            </Style>
                        </Button.Style>
                    </Button>
 
                    <Button FontSize="18" Click="Button_Click" x:Name="maxBtn">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXCaption.MaximizeButtonStyleKey}}">
                                <Setter Property="Focusable" Value="False"/>
                            </Style>
                        </Button.Style>
                    </Button>
 
                    <Button FontSize="18" Click="Button_Click" x:Name="closeBtn">
                        <Button.Style>
                            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXCaption.CloseButtonStyleKey}}">
                                <Setter Property="Focusable" Value="False"/>
                            </Style>
                        </Button.Style>
                    </Button>
                </StackPanel>
 
                <ListBox x:Name="list"
                             
                        Margin="20,15,10,15"
                        Background="#6FFFFFFF"
                        BorderThickness="0"
                             pu:ListBoxHelper.CornerRadius="5"
                             pu:ListBoxHelper.ItemsCornerRadius="5"
                             pu:ListBoxHelper.ItemsBackground="Red"
                             pu:ListBoxHelper.ItemsHoverBackground="#b20000"
                             pu:ListBoxHelper.ItemsSelectedBackground="#b20000"
                             pu:ListBoxHelper.ItemsIcon="&#xe931;"
                             ItemsSource="{Binding Alarms}"
                             Loaded="list_Loaded"
                             
                             FontSize="15"
Foreground="#FFF"
                             
                             pu:IconHelper.FontFamily="/Panuon.WPF.UI;component/Resources/Fonts/#PanuonIcon"
                             pu:IconHelper.Foreground="Green"
                             pu:IconHelper.FontSize="20"
                             pu:IconHelper.Margin="5,0,5,0"
                             FontWeight="UltraBlack"
                            
                             
                             pu:ListBoxHelper.ItemsSeparatorVisibility="Visible"
                             pu:ListBoxHelper.ItemsSeparatorBrush="Transparent"
                             pu:ListBoxHelper.ItemsRemoveButtonVisibility="Visible">
 
                    <ListBox.Style>
                        <Style TargetType="ListBox" BasedOn="{StaticResource {x:Static pu:StyleKeys.ListBoxStyle}}">
                            <Setter Property="Visibility" Value="Visible"/>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Alarms.Count}" Value="0">
                                    <Setter Property="Visibility" Value="Hidden"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </ListBox.Style>
 
                    <ListBox.Resources>
                        <sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">6</sys:Double>
 
                        <ControlTemplate x:Key="VerticalScrollBar" TargetType="RangeBase">
                            <Border Width="{TemplateBinding Width}" CornerRadius="2" 
                                        Background="{DynamicResource CommonBoarder}">
                                <Track Name="PART_Track" IsDirectionReversed="true">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Command="ScrollBar.PageUpCommand" Focusable="False">
                                            <RepeatButton.Template>
                                                <ControlTemplate>
                                                    <Border Background="Transparent"></Border>
                                                </ControlTemplate>
                                            </RepeatButton.Template>
                                        </RepeatButton>
                                    </Track.DecreaseRepeatButton>
                                    <Track.Thumb>
                                        <Thumb Width="{TemplateBinding Width}"  Focusable="False">
                                            <Thumb.Template>
                                                <ControlTemplate>
                                                    <Border Background="Gray"
                                                                CornerRadius="2" />
                                                </ControlTemplate>
                                            </Thumb.Template>
                                        </Thumb>
                                    </Track.Thumb>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton Command="ScrollBar.PageDownCommand" Focusable="False">
                                            <RepeatButton.Template>
                                                <ControlTemplate>
                                                    <Border Background="Transparent"></Border>
                                                </ControlTemplate>
                                            </RepeatButton.Template>
                                        </RepeatButton>
                                    </Track.IncreaseRepeatButton>
                                </Track>
                            </Border>
                        </ControlTemplate>
 
                        <Style x:Key="ScrollStyle_Mobile" TargetType="ScrollBar">
                            <Style.Resources>
                                <sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">6</sys:Double>
                                <sys:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarHeightKey}">6</sys:Double>
                            </Style.Resources>
                            <Style.Triggers>
                                <Trigger Property="Orientation" Value="Vertical">
                                    <Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
                                    <Setter Property="Height" Value="Auto" />
                                    <Setter Property="Margin" Value="0" />
                                    <Setter Property="Template" Value="{DynamicResource VerticalScrollBar}" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
 
 
                        <Style TargetType="ScrollBar" BasedOn="{StaticResource ScrollStyle_Mobile}"/>
                    </ListBox.Resources>
 
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Static pu:StyleKeys.ListBoxItemStyle}}">
                            <Setter Property="Padding" Value="0"/>
                            <Setter Property="VerticalContentAlignment" Value="Center"/>
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            <Setter Property="Height" Value="70"/>
                            <Setter Property="Margin" Value="0,0,0,1"/>
                            <Setter Property="BorderThickness" Value="0"/>
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>
            </DockPanel>
        </DataTemplate>
    </pu:WindowXCaption.HeaderTemplate>
 
    <!--<pu:WindowXCaption.ExtendControl>
        
    </pu:WindowXCaption.ExtendControl>-->
 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
 
        <ctl:MainTabControl Grid.Row="0" x:Name="menuTab">
 
        </ctl:MainTabControl>
 
        <!--<ctl:MenuTabControl Grid.Row="1" x:Name="menuTab" OnTabChange="menuTab_OnTabChange"> </ctl:MenuTabControl>-->
 
 
        <!--<StatusBar Grid.Row="1" Background="{StaticResource HoriBar}"></StatusBar>-->
    </Grid>
</pu:WindowX>