From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 HMI.UI/Style/BaseWindow.xaml.cs |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/HMI.UI/Style/BaseWindow.xaml.cs b/HMI.UI/Style/BaseWindow.xaml.cs
new file mode 100644
index 0000000..af8d802
--- /dev/null
+++ b/HMI.UI/Style/BaseWindow.xaml.cs
@@ -0,0 +1,45 @@
+锘�
+using System.Windows;
+using System.Windows.Controls;
+
+namespace HMI.UI
+{
+    /// <summary>
+    /// MainWindow.xaml 鐨勪氦浜掗�昏緫
+    /// </summary>
+    public partial class BaseWindowTemplate
+    {
+        void Min_Click(object sender, RoutedEventArgs e)
+        {
+            Window.GetWindow(sender as FrameworkElement).WindowState = WindowState.Minimized;
+        }
+
+        void Max_Click(object sender, RoutedEventArgs e)
+        {
+            var temp = Window.GetWindow(sender as FrameworkElement).WindowState;
+            Window.GetWindow(sender as FrameworkElement).WindowState = temp == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
+        }
+
+        void Close_Click(object sender, RoutedEventArgs e)
+        {
+            Window.GetWindow(sender as FrameworkElement).Close();
+        }
+    }
+
+    public partial class BaseWindow : Window
+    {
+        public void AddButton(Button button)
+        {
+            var panelsda = Template.FindName("RightPanel", this);
+            var panel = (StackPanel)this.Template.FindName("RightPanel", this);
+            panel?.Children.Add(button);
+        }
+
+        public void InsertButton(Button button,int index)
+        {
+            var panelsda = Template.FindName("RightPanel", this);
+            var panel = (StackPanel)this.Template.FindName("RightPanel", this);
+            panel?.Children.Insert(index, button);
+        }
+    }
+}

--
Gitblit v1.9.1