NotifyPropertyChangeBehavior Class

Definition

An IStuntBehavior that raises and from property setters.

public class NotifyPropertyChangeBehavior : IStuntBehavior, ICloneable

Remarks

The behavior intercepts the set_ accessors of properties as well as the add_/remove_ accessors of the notify events (the generated event accessors are empty for interface stunts, so the behavior owns subscriber storage and event dispatch end-to-end).

The incoming value is compared against the last value written through the pipeline using Equals(Object?, Object?); no property getter is ever invoked, keeping the behavior Native AOT-friendly. Assigning an unchanged value raises neither event. By default the setter still runs; pass true for shortCircuitUnchanged to skip the setter entirely for unchanged values.

is raised before the setter runs; is raised after a successful set. A throwing setter (or an exception-return) records no value and raises no PropertyChanged.

State is held in instance fields, so each stunt needs its own behavior instance. When using StuntBuilder, register via AddBehavior<NotifyPropertyChangeBehavior>() (or a factory) so every built stunt gets a fresh instance; the behavior also implements ICloneable, so plain instance registrations are cloned per stunt.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Constructors (2)

Methods (3)