public static ICommandBinding CreateSynchronizedPropertyBinding(
this INotifyPropertyChanged source,
string sourcePropertyName,
string targetPropertyName,
Func<Object?, Object?>? format,
bool awaitCompletion,
params Object[]? targets
)
<ExtensionAttribute>
Public Shared Function CreateSynchronizedPropertyBinding (
source As INotifyPropertyChanged,
sourcePropertyName As String,
targetPropertyName As String,
format As Func(Of Object, Object),
awaitCompletion As Boolean,
ParamArray targets As Object()
) As ICommandBinding
public:
[ExtensionAttribute]
static ICommandBinding^ CreateSynchronizedPropertyBinding(
INotifyPropertyChanged^ source,
String^ sourcePropertyName,
String^ targetPropertyName,
Func<Object^, Object^>^ format,
bool awaitCompletion,
... array<Object^>^ targets
)
[<ExtensionAttribute>]
static member CreateSynchronizedPropertyBinding :
source : INotifyPropertyChanged *
sourcePropertyName : string *
targetPropertyName : string *
format : Func<Object, Object> *
awaitCompletion : bool *
targets : Object[] -> ICommandBinding
This method uses a prepared command internally, which is bound to the PropertyChanged event of the specified source object.
The ICommandState, which is created for the underlying command contains the specified property names and formatparameters. Do not remove these state entries; otherwise, the command will throw an InvalidOperationException when executed.
The property with targetPropertyName will be set in the specified targets immediately when this method is called. The targets, which are added later by the ICommandBinding.AddTarget methods, are set only when the PropertyChanged event occurs on the source object.
ArgumentNullException | source, sourcePropertyName or targetPropertyName is . |