From 303e6180d4f3d88e0feafc9515cae3be8117d2e7 Mon Sep 17 00:00:00 2001
From: chr <chrry550@163.com>
Date: 星期四, 07 三月 2024 16:30:18 +0800
Subject: [PATCH] 添加不同平台的行尾文件;

---
 Utils/CanvasHelper.cs |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Utils/CanvasHelper.cs b/Utils/CanvasHelper.cs
index 6950430..246f2a4 100644
--- a/Utils/CanvasHelper.cs
+++ b/Utils/CanvasHelper.cs
@@ -10,22 +10,23 @@
     {
         public static void SetTopZIndex(InnerWindow element, DependencyObject parent, Type targetClass)
         {
+            int max = 0;
+            int zindex = element.Zindex;
+
             for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
             {
                 InnerWindow child = VisualTreeHelper.GetChild(parent, i) as InnerWindow;
                 if (child != null && targetClass == child.GetType())
                 {
-                    if (element == child)
+                    if (element != child && child.Zindex >= zindex)
                     {
-                        child.Zindex = 1;
+                        child.Zindex = child.Zindex-1;
                     }
-                    else
-                    {
-                        child.Zindex = 0;
-                    }
+                   
                 }
-
+                max++;
             }
+            element.Zindex = max;
         }
     }
 }

--
Gitblit v1.9.1