Vixen
dd8b0a81
csharp
public abstract class Component

A reusable piece of interface: some state, and a Build that turns it into elements.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

What a .vxml compiles into. Vixen.Ui.Markup emits a partial class deriving from this whose Build is one statement per element and one effect per dynamic expression — so writing a component by hand and generating one produce the same thing, and the generated half is steppable rather than magic (ADR-002).

Build runs once. That is the whole of ADR-010: there is no render function to call again, no virtual DOM to diff, and no reason to walk a tree that did not change. What changes later changes because an effect ran, and an effect assigns exactly the property it was written for.

Fields and properties (6)

  • public UiElement Root

    The element this component drew itself into.

  • public UiElement Content

    Where a caller's children are projected.

  • protected BuildContext Context

    What built this component.

  • protected internal virtual string TagName

    The element name this component's host answers to.

  • protected virtual string? Style

    The component's own stylesheet, if it declared a <style> block.

  • protected virtual bool StyleIsScoped

    Whether that stylesheet was marked scoped.

Methods (5)

  • protected abstract void Build(BuildContext ctx)

    Builds this component's elements.

  • protected virtual void OnProvide()

    Declares the ambient values this component makes available to everything inside it.

  • protected void Provide<T>(T value) where T : notnull

    Makes a value available to everything this component builds.

  • protected T? Inject<T>()

    The nearest ambient value of that type, looking up from this component.

  • protected virtual void OnUnmounted()

    Called when the component leaves the tree, before its effects are disposed.

Used by (153, showing 40)

  • ActionBarMmo.Ui
  • BagGridMmo.Ui
  • ChatPanelMmo.Ui
  • GalleryHelloUi
  • HierarchyHelloUi
  • HudMmo.Ui
  • InspectorHelloUi
  • LootRollMmo.Ui
  • QuestTrackerMmo.Ui
  • ShellHelloUi
  • UnitFrameMmo.Ui
  • VendorPanelMmo.Ui
  • AmbientConsumerVixen.Ui.Controls.Tests
  • AmbientHostVixen.Ui.Controls.Tests
  • AmbientProviderVixen.Ui.Controls.Tests
  • AmbientValueTestsVixen.Ui.Controls.Tests
  • AsyncArrivalTestsVixen.Ui.Controls.Tests
  • AsyncGuestVixen.Ui.Controls.Tests
  • AsyncHostVixen.Ui.Controls.Tests
  • AttachmentSeamTestsVixen.Ui.Tests
  • BadEventVixen.Ui.Tests
  • BadWatcherVixen.Ui.Controls.Advanced.Tests
  • BarVixen.Ui.Controls.Tests
  • BareVixen.Ui.Tests
  • BindReachSheetVixen.Ui.Controls.Tests
  • BoundVixen.Ui.Tests
  • BoundOverlaySheetVixen.Ui.Controls.Tests
  • BoxedVixen.Ui.Controls.Tests
  • BoxesVixen.Ui.HotReload.Tests
  • BoxesVixen.Ui.HotReload.Tests
  • BranchingVixen.Ui.Tests
  • BranchingRefsVixen.Ui.Tests
  • BrokenBindingTestsVixen.Ui.Tests
  • BuildContextVixen.Ui
  • CarryingVixen.Ui.HotReload.Tests
  • ClickableVixen.Ui.Controls.Tests
  • ClickableVixen.Ui.Tests
  • CommandMenuVixen.Ui.Controls.Tests
  • CompositionTestsVixen.Ui.Tests
  • ConvertedVixen.Ui.Controls.Tests