From 0940f31b7eba1cf6b6a8c1fca72d97cf686e79f2 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期五, 04 七月 2025 10:43:00 +0800
Subject: [PATCH] 优化插件,完善TreeListView
---
WPFProject/PanuonWindow.xaml | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 106 insertions(+), 14 deletions(-)
diff --git a/WPFProject/PanuonWindow.xaml b/WPFProject/PanuonWindow.xaml
index 4f54589..867d337 100644
--- a/WPFProject/PanuonWindow.xaml
+++ b/WPFProject/PanuonWindow.xaml
@@ -11,39 +11,131 @@
WindowStartupLocation="CenterOwner"
WindowState="Maximized"
x:Name="window"
- BorderBrush="{StaticResource MainBorder}"
- Loaded="window_Loaded"
- pu:WindowXCaption.Background="{StaticResource MainBorder}"
- pu:WindowXCaption.Foreground="#FFF" d:DesignHeight="115.146" d:DesignWidth="341.223">
+ 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"
+ 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>
<StackPanel DataContext="{Binding ElementName=window}" Orientation="Horizontal"
- Margin="5,0,0,0">
- <Image Source="{Binding WindowLogo}"
- RenderOptions.BitmapScalingMode="HighQuality"
- Height="{StaticResource TitleFontSize}" />
- <TextBlock FontSize="{StaticResource TitleFontSize}" VerticalAlignment="Center" Text="{Binding WindowTitle}"/>
+ VerticalAlignment="Center"
+ dp:StackPanelHelper.ChildSpace="30" Margin="5,0,0,0" Height="100">
+ <Image Source="{Binding WindowLogo}" 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>
</DataTemplate>
</pu:WindowXCaption.HeaderTemplate>
<pu:WindowXCaption.ExtendControl>
<StackPanel Orientation="Horizontal">
+ <Menu Margin="0" Padding="0" VerticalAlignment="Top"
+ VerticalContentAlignment="Center" Style="{StaticResource UserMenu}"
+
+ Background="Transparent">
+ <MenuItem x:Name="userMenu" FontSize="16">
+ <MenuItem
+ Icon=""
+ Cursor="Hand" FontSize="14" Header="閫�鍑虹櫥褰�"
+ x:Name="MiLogout"
+ Click="MenuItem_Click"/>
+ <MenuItem Cursor="Hand" FontSize="14"
+ Icon=""
+ Header="閲嶆柊鍚姩"
+ x:Name="MiRestart"
+ Click="MenuItem_Click"/>
+ </MenuItem>
+ </Menu>
+
<Button x:Name="BtnSwitchTheme"
FontSize="18"
- ToolTip="Light / Dark"
- Style="{StaticResource {x:Static pu:WindowXCaption.MinimizeButtonStyleKey}}"
FontFamily="/HMI.UI;component/Resources/Font/#iconfont"
Content=""
- Click="Button_Click_2"/>
+ 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"/>
+ </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>
</pu:WindowXCaption.ExtendControl>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
- <RowDefinition Height="30"/>
+ <RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ctl:MainTabControl Grid.Row="0" x:Name="menuTab">
@@ -53,6 +145,6 @@
<!--<ctl:MenuTabControl Grid.Row="1" x:Name="menuTab" OnTabChange="menuTab_OnTabChange"> </ctl:MenuTabControl>-->
- <StatusBar Grid.Row="1" Background="{StaticResource MainStatusBar}">99999</StatusBar>
+ <!--<StatusBar Grid.Row="1" Background="{StaticResource HoriBar}"></StatusBar>-->
</Grid>
</pu:WindowX>
--
Gitblit v1.9.1