navigating-mewui-tree

Solid

Traverses and manipulates the MewUI visual tree. Use when understanding element hierarchy, finding parent/child elements, implementing IVisualTreeHost, or working with element lifecycle.

Web & Frontend 40 stars 6 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
54
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

## Element Hierarchy ``` Element (base) └─ UIElement (input, visibility, focus) └─ FrameworkElement (sizing, margin, alignment) ├─ Panel (multi-child: StackPanel, Grid, Canvas, DockPanel) ├─ Control (themed elements: Button, Label, TextBox) │ ├─ ContentControl (single child: Window) │ └─ Border (decorator) └─ ... ``` --- ## Parent-Child Relationships ```csharp // Every element has one parent Element? parent = element.Parent; // Multi-child (Panel) panel.Add(child); // Sets child.Parent = panel panel.Remove(child); // Sets child.Parent = null panel.Children; // IReadOnlyList<Element> // Single-child (ContentControl, Border) contentControl.Content = child; // Element? type, sets child.Parent border.Child = child; // UIElement? type ``` --- ## Tree Traversal ```csharp // Find visual root (usually Window) Element? root = element.FindVisualRoot(); // Check ancestry bool isChild = element.IsDescendantOf(ancestor); bool isParent = element.IsAncestorOf(descendant); // Also available // Find ancestor of type static T? FindAncestor<T>(Element element) where T : Element { for (var cur = element.Parent; cur != null; cur = cur.Parent) if (cur is T match) return match; return null; } ``` Note: `VisualTree.Visit()` exists but is `internal` - use FindVisualRoot/IsDescendantOf for external code. --- ## IVisualTreeHost (Internal) Interface for elements with children (internal API): ```csharp intern...

Details

Author
christian289
Repository
christian289/dotnet-with-claudecode
Created
7 months ago
Last Updated
6 days ago
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category