Vixen
02b45cc4
csharp
public abstract class Control

What every control in the set has in common.

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

Remarks

Three things, and deliberately not more. Whether it is disabled, how prominent it is, and how big — because those are the three questions asked of every control by somebody who is not writing a stylesheet. Everything else a control looks like is CSS, which is the whole reason the styling engine exists.

⚠ ControlVariant and ControlSize are written through to classes — variant-primary, size-sm — rather than read by anything here. That is what puts them in reach of the cascade: a game can restyle button.variant-danger, add a variant of its own with a plain class, and override one control's size with a selector, none of which is possible for a property this assembly interprets itself.

The class names are prefixed because they land in the same namespace as the application's own. .primary would be a collision waiting to happen in every project that has ever had a primary anything.

Fields and properties (7)

  • public bool Disabled
  • public ControlVariant Variant
  • public ControlSize Size
  • protected virtual bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public static readonly UiPropertyKey DisabledProperty

    Identity for Disabled.

  • public static readonly UiPropertyKey VariantProperty

    Identity for Variant.

  • public static readonly UiPropertyKey SizeProperty

    Identity for Size.

Events (1)

  • public Action<Control>? Clicked

    Raised when the control is activated.

Methods (9)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • protected void WhenResized(Action handler)

    Runs something after any layout pass in which this control's box changed size.

  • protected override void OnRemoved()

    Called once, as the element leaves the document.

  • protected UiElement Part(string tag, params string[] classNames)

    Adds one of this control's own parts.

  • protected T Part<T>(string? tag = null, params string[] classNames) where T : UiElement, new()

    Adds one of this control's own parts, of a particular type.

  • protected void RaiseClick(ActivationDevice device, int count = 1, ModifierKeys modifiers = None)

    Raises a ClickEvent from this control and tells the direct subscribers.

  • public void ClearDisabled()

    Unsets Disabled, so it takes its default or its ancestor's value again.

  • public void ClearVariant()

    Unsets Variant, so it takes its default or its ancestor's value again.

  • public void ClearSize()

    Unsets Size, so it takes its default or its ancestor's value again.

Used by (175, showing 40)

  • ShellHelloUi
  • AccordionVixen.Ui.Controls
  • AlertVixen.Ui.Controls
  • AvatarVixen.Ui.Controls
  • BadgeVixen.Ui.Controls
  • BreadcrumbVixen.Ui.Controls
  • ButtonBaseVixen.Ui.Controls
  • ButtonTestsVixen.Ui.Controls.Tests
  • CardVixen.Ui.Controls
  • CheckBoxVixen.Ui.Controls
  • CodeEditorVixen.Ui.Controls.Advanced
  • ColorFieldVixen.Ui.Controls.Advanced
  • ColorInputVixen.Ui.Controls.Advanced
  • ColorPickerVixen.Ui.Controls.Advanced
  • ColorStripVixen.Ui.Controls.Advanced
  • ColorSwatchVixen.Ui.Controls.Advanced
  • ComboBoxVixen.Ui.Controls
  • ControlMarkupVixen.Ui.Controls
  • ControlVisualTestsVixen.Ui.Controls.Tests
  • CurveEditorVixen.Ui.Controls.Advanced
  • DataCellVixen.Ui.Controls.Advanced
  • DataGridVixen.Ui.Controls.Advanced
  • DataHeaderCellVixen.Ui.Controls.Advanced
  • DataRowVixen.Ui.Controls.Advanced
  • DialogVixen.Ui.Controls
  • DisabledStateTestsVixen.Ui.Controls.Tests
  • DockGroupViewVixen.Ui.Controls.Advanced
  • DockPanelVixen.Ui.Controls.Advanced
  • DockSplitterViewVixen.Ui.Controls.Advanced
  • DockTabVixen.Ui.Controls.Advanced
  • DockingHostVixen.Ui.Controls.Advanced
  • DockingTestsVixen.Ui.Controls.Advanced.Tests
  • DrawerVixen.Ui.Controls
  • EmptyStateVixen.Ui.Controls
  • ExpanderVixen.Ui.Controls
  • ExpanderHeaderVixen.Ui.Controls
  • GradientBarVixen.Ui.Controls.Advanced
  • GradientEditorVixen.Ui.Controls.Advanced
  • GradientRailVixen.Ui.Controls.Advanced
  • IconVixen.Ui.Controls