This commit is contained in:
zengwenjie
2025-09-28 18:03:56 +08:00
parent 097f35406f
commit 6e6e9ee99b

View File

@@ -246,5 +246,14 @@ namespace Deedy
} }
} }
} }
public Window? GetWindow()
{
DependencyObject parent = this;
while (parent != null && !(parent is Window))
{
parent = VisualTreeHelper.GetParent(parent);
}
return parent as Window;
}
} }
} }