Skip to content

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

Attributes: [EditorBrowsable(EditorBrowsableState.1)]

public static bool ShouldBind(object? source, object target, Func<IObservedChange<object, object>[]> getSourceProperties, Func<IObservedChange<object, object>[]> getTargetProperties, BindingDirection direction)

View source

Summary: Asks every registered hook whether this binding may be created.

Parameters

NameTypeDescription
sourceobject?The source object, typically the view model.
targetobjectThe target object, typically the view.
getSourcePropertiesFunc[]>Reads the current source-side values.
getTargetPropertiesFunc[]>Reads the current target-side values.
direction[BindingDirection](#Which way the binding runs.

Returns: bool -- true when the binding may proceed; false when a hook refused it.

Exceptions

TypeCondition
System.ArgumentNullExceptionA required argument is null.