From 12e606635c42ea20f4b7c2bdda5204237a4b4c96 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期一, 02 三月 2026 16:14:49 +0800
Subject: [PATCH] 优化
---
HMI.UI/Controls/treegrid/Controls/TreeDataGrid.cs | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/HMI.UI/Controls/treegrid/Controls/TreeDataGrid.cs b/HMI.UI/Controls/treegrid/Controls/TreeDataGrid.cs
index 8823656..8dc00d4 100644
--- a/HMI.UI/Controls/treegrid/Controls/TreeDataGrid.cs
+++ b/HMI.UI/Controls/treegrid/Controls/TreeDataGrid.cs
@@ -19,10 +19,10 @@
static TreeDataGrid()
{
- //ScrollViewer.HorizontalScrollBarVisibilityProperty
- // .OverrideMetadata(typeof(TreeDataGrid), new FrameworkPropertyMetadata(ScrollBarVisibility.Disabled));
- //ScrollViewer.VerticalScrollBarVisibilityProperty
- // .OverrideMetadata(typeof(TreeDataGrid), new FrameworkPropertyMetadata(ScrollBarVisibility.Disabled));
+ ScrollViewer.HorizontalScrollBarVisibilityProperty
+ .OverrideMetadata(typeof(TreeDataGrid), new FrameworkPropertyMetadata(ScrollBarVisibility.Disabled));
+ ScrollViewer.VerticalScrollBarVisibilityProperty
+ .OverrideMetadata(typeof(TreeDataGrid), new FrameworkPropertyMetadata(ScrollBarVisibility.Disabled));
}
protected override DependencyObject GetContainerForItemOverride()
@@ -50,10 +50,10 @@
{
oldTreeData.IsExpandedChange -= DataIsExpandedChange;
oldTreeData.VisibleChange -= DataVisiableChange;
-
}
if (DataContext != null && DataContext is TreeItemData treeData)
{
+ Visibility = treeData.IsVisible ? Visibility.Visible : Visibility.Collapsed;
treeData.IsExpandedChange += DataIsExpandedChange;
treeData.VisibleChange += DataVisiableChange;
}
--
Gitblit v1.9.1