| | |
| | | using System.Windows; |
| | | using System.Windows.Controls; |
| | | using System.Windows.Media; |
| | | using WPFProject.Controls; |
| | | |
| | | namespace WPFProject.Utils |
| | | { |
| | | public class CanvasHelper |
| | | { |
| | | public static void SetTopZIndex(object element, DependencyObject parent, Type targetClass) |
| | | public static void SetTopZIndex(InnerWindow element, DependencyObject parent, Type targetClass) |
| | | { |
| | | for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++) |
| | | { |
| | | UIElement child = VisualTreeHelper.GetChild(parent, i) as UIElement; |
| | | InnerWindow child = VisualTreeHelper.GetChild(parent, i) as InnerWindow; |
| | | if (child != null && targetClass == child.GetType()) |
| | | { |
| | | if (element == child) |
| | | { |
| | | Canvas.SetZIndex(child, 1); |
| | | child.Zindex = 1; |
| | | } |
| | | else |
| | | { |
| | | Canvas.SetZIndex(child, 0); |
| | | child.Zindex = 0; |
| | | } |
| | | } |
| | | |