From 9211ec11c112e18cd99e77f889a01110a70031ce Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 24 十一月 2025 17:47:15 +0800
Subject: [PATCH] 优化项目结构
---
HMI.ParameterManage/ParameterSetting.xaml | 36 ++++++++++++++++++++++++++++++++++--
1 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/HMI.ParameterManage/ParameterSetting.xaml b/HMI.ParameterManage/ParameterSetting.xaml
index cc093dc..bb7d71f 100644
--- a/HMI.ParameterManage/ParameterSetting.xaml
+++ b/HMI.ParameterManage/ParameterSetting.xaml
@@ -17,8 +17,14 @@
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/HMI.UI;component/Style/PanuonDataGrid.xaml"/>
+ <!--<pu:StyleDictionary Includes="Expander" />-->
</ResourceDictionary.MergedDictionaries>
+
+ <CollectionViewSource x:Key="GroupFilter" Source="{Binding Datasource}">
+ <CollectionViewSource.GroupDescriptions>
+ <PropertyGroupDescription PropertyName="ShowGroup" />
+ </CollectionViewSource.GroupDescriptions>
+ </CollectionViewSource>
</ResourceDictionary>
</UserControl.Resources>
<Border Style="{StaticResource CardBoarder}">
@@ -56,7 +62,33 @@
</DockPanel>
<DataGrid Grid.Row="2" x:Name="table" Style="{StaticResource DefaultDataGrid}"
- ItemsSource="{Binding Datasource}">
+ ItemsSource="{Binding Source={StaticResource GroupFilter}}">
+ <DataGrid.GroupStyle>
+ <GroupStyle>
+ <GroupStyle.ContainerStyle>
+ <Style TargetType="{x:Type GroupItem}">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type GroupItem}">
+ <Expander BorderThickness="0" Background="DarkCyan"
+ IsExpanded="True">
+ <Expander.Header>
+ <TextBlock Text="{Binding Name}" FontSize="15"
+ Margin="8"
+ Foreground="#FFF"/>
+ </Expander.Header>
+ <Border Background="#FFF">
+ <ItemsPresenter />
+ </Border>
+ </Expander>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </GroupStyle.ContainerStyle>
+ </GroupStyle>
+ </DataGrid.GroupStyle>
+
<DataGrid.Columns>
<DataGridTemplateColumn Header="" Width="Auto" CanUserResize="False">
<DataGridTemplateColumn.CellTemplate>
--
Gitblit v1.9.1