KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Ok, I know that FrameworkElement , which is a direct subclass of UIElement , has a Parent property, but Panel objects have children of type UIElement , not FrameworkElement (The Children property 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 know a panel doesn't have a template so maybe that's the way, but still...) So asides from the VisualTreeHelper , how can you determine which panel (if any) is the parent of a UIElement ? (...and have any thoughts why they didn't just define a Parent property there instead of on FrameworkElement ?) Thanks!
Tags (comma-separated)
Save Edits
Cancel