mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:16:30 +00:00
20 lines
462 B
C#
20 lines
462 B
C#
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;
|
|
}
|
|
} |