public sealed class BuildContextWhat a Component's Build constructs with, and what Vixen.Ui.Markup emits calls to.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Per ADR-010 every method here does one thing once. Element creates an element; Attribute sets a value that will never change; Bind registers one effect that assigns one property. Nothing walks a tree, nothing diffs, and a steady-state interface allocates nothing because nothing runs.
The two exceptions are Switch and For``1, which is the point: those are the only two places where the shape of the tree depends on state, so those are the only two places that add and remove elements.
Fields and properties (4)
public const string DefaultSlotThe name of the slot a component's children go to when they name none.
public UiDocument DocumentThe document being built into.
public UiElement MountThe element the root component hangs from.
public UiElement AnchorWhat a null parent means right now.
Methods (21)
public static T Build<T>(UiDocument document, UiElement mount) where T : Component, new()Builds a component into a document.
public static BuildContext BuildInto(Component component, UiDocument document, UiElement mount)Builds an already-created component, so a caller can choose how it was made.
public void Rebuild(Component component)Throws away what a component built and builds it again.
public UiElement Element(UiElement? parent, string tag)Creates an intrinsic element.
public T Child<T>(UiElement? parent) where T : IComposable, new()Creates whatever a capitalised tag named, and builds it if it is a component.
public static UiElement Host(Component component)The element an attribute written on a capitalised tag applies to.
public static UiElement Host(UiElement element)public static UiElement Inner(Component component)Where the content written inside a capitalised tag goes.
public static UiElement Inner(UiElement element)public static void Subscribe(string name, Action<UiElement, Action<UiEvent>, RoutingStrategy> subscribe)Teaches the runtime an event name, or changes what one already means.
public UiElement Text(UiElement? parent, string text)Creates an element holding fixed text.
public UiElement Text(UiElement? parent, Func<object?> text)Creates an element holding text that follows an expression.
public void Attribute(UiElement target, string name, string value)Sets a value that will not change.
public void Bind(UiElement target, string name, Func<object?> value)Keeps an attribute equal to an expression.
public void Bind(Action assign)Runs an assignment now, and again whenever what it read changes.
public void On(UiElement target, string name, Action handler, params string[] modifiers)Subscribes a handler to an event by name.
public void On<TEvent>(UiElement target, string name, Action<TEvent> handler, params string[] modifiers) where TEvent : UiEventSubscribes a handler that wants the event.
public void TwoWay<T>(UiElement target, string name, Func<T> get, Action<T> set)Binds a property in both directions.
public void Slot(UiElement? parent, string name)Declares where a caller's children go.
public void Switch(UiElement? parent, Func<int> arm, Action<BuildContext, UiElement, int> build)Builds whichever arm a selector picks, and rebuilds when it picks another.
public void For<T>(UiElement? parent, Func<IEnumerable<T>> items, Func<T, object> key, Action<BuildContext, UiElement, T> build)Builds one subtree per item, keyed, and reconciles when the sequence changes.
Used by (44, showing 40)
- BadEventVixen.Ui.Tests
- BarVixen.Ui.Controls.Tests
- BareVixen.Ui.Tests
- BoundVixen.Ui.Tests
- BoxesVixen.Ui.HotReload.Tests
- BranchingVixen.Ui.Tests
- CarryingVixen.Ui.HotReload.Tests
- ClickableVixen.Ui.Tests
- ComponentVixen.Ui
- CompositionTestsVixen.Ui.Tests
- ControlMarkupVixen.Ui.Controls
- CounterVixen.Ui.Tests
- CountingVixen.Ui.HotReload.Tests
- EffectPassTestsVixen.Ui.Tests
- EmitterTestsVixen.Ui.Markup.Tests
- EntryVixen.Ui.HotReload
- FocusableVixen.Ui.HotReload.Tests
- GuestVixen.Ui.Tests
- HostVixen.Ui.Tests
- HostingVixen.Ui.Tests
- HotReloadHostVixen.Ui.HotReload
- LeadingBranchVixen.Ui.Tests
- ListingVixen.Ui.Tests
- LooseVixen.Ui.Tests
- MarkupTestsVixen.Ui.Controls.Tests
- MixedVixen.Ui.Tests
- NestedVixen.Ui.Tests
- OuterVixen.Ui.Tests
- PanelVixen.Ui.Tests
- PlainVixen.Ui.Controls.Tests
- PressableVixen.Ui.Controls.Tests
- ProjectingVixen.Ui.HotReload.Tests
- ScopedVixen.Ui.Tests
- ScopedStyleTestsVixen.Ui.Tests
- SwitchingVixen.Ui.Tests
- VxmlGeneratorTestsVixen.Ui.Markup.Generators.Tests
- BrushInspectorMarkupTestsVixen.Editor.Terrain.Tests
- EditorApplicationVixen.Editor.App
- EditorShellVixen.Editor.Ui
- MarkupInspectorVixen.Editor.Inspector