mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 15:56:30 +00:00
rework to Azaion.Suite
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user