Skip to content

BindingHooks class

Defined in

Namespace: ReactiveUI.Binding.Reactive Assembly: ReactiveUI.Binding.Reactive.dll Full name: ReactiveUI.Binding.Reactive.BindingHooks Modifiers: public static

Summary

View source

Lets a registered IPropertyBindingHook inspect, or refuse, a binding as it is created.

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-ios18.0, net9.0-macos15.0, net9.0-desktop1.0, net8.0, net8.0-macos14.5, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, netstandard2.1, net481, net462, net471

Remarks

A hook is consulted once per binding, before anything is wired, and a hook that returns false cancels the binding outright. Registration is by the service locator, so the set is only known at run time even though the binding itself was resolved at compile time.

Nothing is asked of the locator until a hook is actually registered. Almost no application registers one, and a binding is created per control per view, so paying for a service lookup and two property-chain closures on every one of them would be a cost the overwhelming majority never gets anything back for. Any is the guard a caller tests first, and it stays false until Refresh is told the registrations changed.

Properties

NameSummary
static AnyGets a value indicating whether any hook is registered.

Methods

NameSummary
static RefreshRe-reads the registered hooks, for a host that registers them after the first binding.
static ShouldBindAsks every registered hook whether this binding may be created.
Inherited members