Vixen
02b45cc4
csharp
public sealed class UiPropertyGenerator

Implements the partial properties marked [UiProperty].

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

Remarks

What a UI property needs beyond an auto-property is an identity — a stylesheet, an animation, a binding and an inspector all have to find it by name at runtime — plus a change callback, coercion, and the option of taking an ancestor's value when it has none of its own. Written by hand that is thirty lines per property that all look alike and one of which will eventually be wrong.

Generated rather than reflected, and generated rather than rewritten: Stride builds the equivalent with a runtime DependencyPropertyFactory, and ADR-002 rejects the whole category. Output that can be read and stepped through is strictly better, and it survives trimming because there is nothing to look up.

⚠ Inheritance is generated as a typed walk, not a dictionary lookup. Each inheriting property emits its own loop that tests ancestor is TOwner — so the inherited value comes from the nearest ancestor that actually declares the property, and a sibling type that happens to have a property of the same name is not it.

Methods (1)

  • public void Initialize(IncrementalGeneratorInitializationContext context)

    Called to initialize the generator and register generation steps via callbacks on the