I have got some generic User Control under the Canvas of the WPF window.
How do I can get that window?
I used this approach
void UserControlMethod()
{
WindowInteropHelper WindowInteropHelper = new WindowInteropHelper((Window)((Grid)(((Canvas)this.Parent).Parent)).Parent);
}
Is this correct?
Thank you!
You should use:
Window.GetWindow().The
WindowInteropHelperis for interacting with native windows code or API’s so that’s definitely not what you want.