UiElement
- Namespace: Turian.Engine.UI
- Source File: UiElement.cs
A single node in a parsed .ui document tree.
Properties
Tag
(string) = "VisualElement": Local element name, e.g. Label, Button, VisualElement.
Namespace
(string?) : XML namespace the element was declared in, or null for the default UI namespace.
Name
(string?) : The name attribute — the element's id within the document, or null.
Classes
(List[]: USS classes from the class attribute.
Attributes
(Dictionary<string, string>) = []: Every attribute as written, keyed by name. Includes style, typed attributes and any unknown ones; excludes name, class, binding-* and recognised events.
InlineStyle
(Dictionary<string, string>) = []: Declarations parsed from the inline style="prop: val; …" attribute.
AttributeBindings
(List[]: Bindings declared inline as binding-<attr>="{ … }".
Events
(Dictionary<string, string>) = []: Event handlers: event name (e.g. click) → controller method name.
Text
(string?) : Inner text of a leaf element (used as text when no text attribute is set).
Repeat
(UiRepeat?) : Set when this element is a <Repeat>; its Children are the row template.
Instance
(UiInstanceRef?) : Set when this element is an <Instance> of a template.
Children
(List[]: Child elements in document order.
Line
(int) : 1-based source line, for diagnostics. 0 when unknown.
Column
(int) : 1-based source column, for diagnostics. 0 when unknown.
Public Methods
DescendantsAndSelf
public IEnumerable<UiElement> DescendantsAndSelf()
Depth-first enumeration of this element and its descendants.
Returns: IEnumerable<UiElement>
Find
public UiElement? Find(string name)
Finds the first descendant (or self) with the given name.
Parameters:
name(string): The element name to search for.
Returns: UiElement?