Vixen
dd8b0a81
csharp
public readonly record struct EventSubscription

How an on: binding attaches itself, for the table that decides what a name means.

Read the guide page for this →

Remarks

⚠ A pair rather than a RoutingStrategy, and the second half is why. Everything else an on: modifier says — stop, once, self — is a filter On``1 can apply around a handler it already owns. Whether the handler is called at all once something downstream has marked the event handled is AddHandler``1's third argument, which only the subscription itself can pass. So the entry has to be told, and a table whose entries took a bare strategy could never spell on:pointerdown.handled.

Use Listen``1 rather than calling AddHandler. An entry that passed the strategy and forgot the flag would compile, work for every binding without the modifier, and silently ignore it for the ones that asked — which is the failure mode this whole seam exists to avoid. One call carries both.

Fields and properties (2)

  • public RoutingStrategy Strategy

    Which leg of the route to listen on.

  • public bool HandledEventsToo

    Whether to run even after something has marked the event handled.

Methods (1)

  • public void Listen<T>(UiElement element, Action<UiElement, T> handler) where T : UiEvent

    Subscribes a handler the way this says to.

Used by (2)

  • BuildContextVixen.Ui
  • ControlMarkupVixen.Ui.Controls