查找与替换完成

This commit is contained in:
艾竹
2023-04-15 21:55:27 +08:00
parent ce2e44fe49
commit c6bc57140f
15 changed files with 680 additions and 91 deletions

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace AIStudio.Wpf.DiagramDesigner.Controls
{
public class DiagramTabControl : TabControl
{
public DiagramTabControl()
{
// Attach event handler to TabControl.SelectionChanged event
this.SelectionChanged += DiagramTabControl_SelectionChanged;
this.IsVisibleChanged += DiagramTabControl_IsVisibleChanged;
}
private void DiagramTabControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
foreach (var item in this.Items)
{
if (item is DiagramViewModel viewModel)
{
viewModel.ShowSearch = false;
}
}
}
private void DiagramTabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// Iterate through all TabItems and manually set the Visibility property
foreach (var item in this.Items)
{
if (item is DiagramViewModel viewModel)
{
if (item != this.SelectedItem)
{
viewModel.ShowSearch = false;
}
}
}
}
}
}