From ef52fd6fd07508883dce4eb002acda59f0169e59 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 23 四月 2026 10:19:33 +0800
Subject: [PATCH] 优化;
---
WPFProject/Controls/MenuTabControl.xaml.cs | 49 +++++++++++++++++++++++++------------------------
1 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/WPFProject/Controls/MenuTabControl.xaml.cs b/WPFProject/Controls/MenuTabControl.xaml.cs
index 9a765d1..8d0b400 100644
--- a/WPFProject/Controls/MenuTabControl.xaml.cs
+++ b/WPFProject/Controls/MenuTabControl.xaml.cs
@@ -1,11 +1,10 @@
-锘縰sing System;
+锘縰sing HMI.Core.Api;
+using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
-using HMI.Core.Api;
-using WPFProject.UI;
namespace WPFProject.Controls
{
@@ -99,26 +98,26 @@
public MenuTabControl()
{
- IPlugin plugin = new WorkControl();
- ChildTabChanged += plugin.OnTabChange;
+ //IPlugin plugin = new WorkControl();
+ //ChildTabChanged += plugin.OnTabChange;
- DataContext = this;
- InitializeComponent();
- Items = new ObservableCollection<IconTabItem> {
- new IconTabItem(){
- Header="111",
- Children = new ObservableCollection<IconTabItem>{
- new IconTabItem(){
- Header = "112",
- Content = plugin
- }
- }
- },
- new IconTabItem(){
- Header="222",
- Children = new ObservableCollection<IconTabItem>()
- }
- };
+ //DataContext = this;
+ //InitializeComponent();
+ //Items = new ObservableCollection<IconTabItem> {
+ //new IconTabItem(){
+ // Header="111",
+ // Children = new ObservableCollection<IconTabItem>{
+ // new IconTabItem(){
+ // Header = "112",
+ // Content = plugin
+ // }
+ // }
+ //},
+ //new IconTabItem(){
+ // Header="222",
+ // Children = new ObservableCollection<IconTabItem>()
+ //}
+ //};
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
@@ -156,8 +155,10 @@
foreach (IconTabItem item in Items)
{
item.Visibility = ItemVisibility;
- if (item.Children != null) {
- foreach (var child in item.Children) {
+ if (item.Children != null)
+ {
+ foreach (var child in item.Children)
+ {
child.Visibility = ItemVisibility;
}
}
--
Gitblit v1.9.1