How can you get the parent of a UIElement?
问题 Ok, I know that FrameworkElement , which is a direct subclass of UIElement , has a Parent property, but Panels have children of type UIElement , not FrameworkElement (Children is of type UIElementCollection ) which seems it would mean you can add UIElement s directly to a Panel. That said, if you have a UIElement and want to see if it has a parent that's a panel, the only way I know how to test this is with the VisualTreeHelper , but that's the visual tree, not the logical tree. (At least we