Search code examples
c#.netwpfframeworkelement

Is it possible to identify which window/usercontrol owns a FrameworkElement?


Is it possible to identify which window/usercontrol owns a FrameworkElement?

Thank you.


Solution

  • 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.