using System.Windows; using Azaion.Common.DTO; namespace Azaion.Common.Extensions; public static class WindowExtensions { public static WindowEnum GetParentWindow(this FrameworkElement? element) { while (element != null && element is not Window) { element = element.Parent as FrameworkElement; } if (element is not Window) return WindowEnum.None; return WindowEnum.Annotator; } }