Vixen
02b45cc4

UiPropertyAttribute

annotation Core/Vixen.Ui/UiProperty.cs:28
csharp
public sealed class UiPropertyAttribute

Marks a partial property as one the UI framework knows about by name.

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

As a annotation

Valid on
Property

Remarks

A plain C# property is invisible to everything that has to find it at runtime: a stylesheet naming it, an animation targeting it, a binding writing it, an inspector listing it. This gives it an identity without giving up the typed accessor — the generator emits both, so element.Radius is a field read and key.SetValue(element, 4f) reaches the same field.

⚠ Storage is a field, not a sparse table, which is the opposite of what WPF does and deliberate. A dependency-property table pays a dictionary probe per read to save memory on the hundreds of properties a WPF element declares and never sets; a Vixen control declares perhaps a dozen, there are 10⁴ elements rather than 10⁶, and reads happen every frame. The table would be the more famous design and the slower one.

Fields and properties (4)

  • public bool Inherits

    Whether an element with no value of its own takes its nearest ancestor's.

  • public object? Default

    The value an element has before anything sets one.

  • public string? Changed

    A method to call after the value changes. void M(T oldValue, T newValue).

  • public string? Coerce

    A method to run a value through before storing it. T M(T value).

Used by (48, showing 40)

  • AccordionVixen.Ui.Controls
  • AvatarVixen.Ui.Controls
  • BreadcrumbItemVixen.Ui.Controls
  • CardVixen.Ui.Tests
  • CheckBoxVixen.Ui.Controls
  • CodeEditorVixen.Ui.Controls.Advanced
  • ColorPickerVixen.Ui.Controls.Advanced
  • ControlVixen.Ui.Controls
  • CurveEditorVixen.Ui.Controls.Advanced
  • DataGridVixen.Ui.Controls.Advanced
  • DockPanelVixen.Ui.Controls.Advanced
  • DrawerVixen.Ui.Controls
  • ExpanderVixen.Ui.Controls
  • IconVixen.Ui.Controls
  • ImageVixen.Ui.Controls
  • KeyboardShortcutVixen.Ui.Controls
  • LinkVixen.Ui.Controls
  • MultiSelectVixen.Ui.Controls
  • NodeCanvasVixen.Ui.Controls.Advanced
  • NumericInputVixen.Ui.Controls
  • OptionVixen.Ui.Controls
  • OverlayVixen.Ui.Controls
  • OverlayVixen.Ui.Tests
  • PaginationVixen.Ui.Controls
  • PanelVixen.Ui.Tests
  • ProgressBarVixen.Ui.Controls
  • RadioButtonVixen.Ui.Controls
  • RadioGroupVixen.Ui.Controls
  • RangeBaseVixen.Ui.Controls
  • RangeSliderVixen.Ui.Controls
  • ScrollBarVixen.Ui.Controls
  • ScrollViewVixen.Ui.Controls
  • SelectVixen.Ui.Controls
  • SeparatorVixen.Ui.Controls
  • SliderVixen.Ui.Controls
  • SpinnerVixen.Ui.Controls
  • TabsVixen.Ui.Controls
  • TextFieldVixen.Ui.Controls
  • TimelineVixen.Ui.Controls.Advanced
  • ToastVixen.Ui.Controls