Command Class

Contains extension methods for the ICommand and INotifyPropertyChanged types as well as a couple of property binding creation methods for any object.
See the Remarks section of the ICommand interface for details and examples about commands.

Definition

Namespace: KGySoft.ComponentModel
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
public static class Command
Inheritance
Object    Command

Methods

CreateBinding(ICommand, IDictionaryString, Object, Boolean) Creates a binding for a command without any sources and targets. At least one source must be added by the ICommandBinding.AddSource method to make the command invokable. Targets can be added by the ICommandBinding.AddTarget method.
CreateBinding(ICommand, Object, String, Object) Creates a binding for a command using the specified source, eventName and targets.
CreateBinding(ICommand, Object, String, IDictionaryString, Object, Object) Creates a binding for a command using the specified source, eventName and targets as well as the optionally provided initial state of the binding.
CreatePropertyBinding(INotifyPropertyChanged, String, String, Object) Creates a special binding for the PropertyChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source.
CreatePropertyBinding(Object, String, String, Object) Creates a special binding for the PropertyChanged or sourcePropertyNameChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source.
CreatePropertyBinding(INotifyPropertyChanged, String, String, FuncObject, Object, Object) Creates a special binding for the PropertyChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source.
CreatePropertyBinding(Object, String, String, FuncObject, Object, Object) Creates a special binding for the PropertyChanged or sourcePropertyNameChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source.
CreatePropertyChangedHandlerBinding(INotifyPropertyChanged, Action, String) Creates a special command binding for the PropertyChanged event of the specified source that invokes the specified handler only when the changed property is among the specified propertyNames.
CreatePropertyChangedHandlerBinding(INotifyPropertyChanged, ActionString, String) Creates a special command binding for the PropertyChanged event of the specified source that invokes the specified handler only when the changed property is among the specified propertyNames.
CreateSynchronizedPropertyBinding(INotifyPropertyChanged, String, String, Boolean, Object) Creates a special binding for the PropertyChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source. The target properties will be set using the SynchronizationContext of the thread on which this method was called.
CreateSynchronizedPropertyBinding(Object, String, String, Boolean, Object) Creates a special binding for the PropertyChanged or sourcePropertyNameChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source. The target properties will be set using the SynchronizationContext of the thread on which this method was called.
CreateSynchronizedPropertyBinding(INotifyPropertyChanged, String, String, FuncObject, Object, Boolean, Object) Creates a special binding for the PropertyChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source. The target properties will be set using the SynchronizationContext of the thread on which this method was called.
CreateSynchronizedPropertyBinding(Object, String, String, FuncObject, Object, Boolean, Object) Creates a special binding for the PropertyChanged or sourcePropertyNameChanged event of the specified source, which allows to update the specified targetPropertyName in the targets, when the property of sourcePropertyName changes in the source. The target properties will be set using the SynchronizationContext of the thread on which this method was called.
CreateTwoWayPropertyBinding(INotifyPropertyChanged, String, INotifyPropertyChanged, String, FuncObject, Object, FuncObject, Object) Creates a pair of special bindings for the PropertyChanged event of the specified source and target, which allow to update the specified targetPropertyName and sourcePropertyName in both directions when any of them changes.
CreateTwoWayPropertyBinding(Object, String, Object, String, FuncObject, Object, FuncObject, Object) Creates a pair of special bindings for the PropertyChanged or sourcePropertyNameChanged event of the specified source and target, which allow to update the specified targetPropertyName and sourcePropertyName in both directions when any of them changes.

See Also