I'm trying to get the Window
instance which is hosting a UIElement
instance in WinUI 3.
There's a helper method in the Window class in .NET (see this thread) but i cannot find something similar for C++/WinRT.
I tried VisualTreeHelper
as some suggested but it doesn't help here; none of the parents were of type winrt::Microsoft::UI::Xaml::Window
.
Is it possible to get the hosting Window
of a dependency object?