Is it possible to identify which window/usercontrol owns a FrameworkElement?
Thank you.
Is it possible to identify which window/usercontrol owns a FrameworkElement?
Thank you.
On
Or you could just use the static helper method GetWindow(DependencyObject dependencyObject) from the Window class. This method returns the Window object that hosts the element.
You can "walk up" using the
.Parent-Property until you find the window or usercontrol. Just check the type of the parent while walking up.