CommandCreateBinding(ICommand, Object, String, IDictionaryString, Object, Object) Method
Creates a binding for a command using the specified source, eventName and targets as well as the optionally provided initial state of the binding.
Namespace: KGySoft.ComponentModelAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
public static ICommandBinding CreateBinding(
this ICommand command,
Object source,
string eventName,
IDictionary<string, Object?>? initialState = null,
params Object[]? targets
)
<ExtensionAttribute>
Public Shared Function CreateBinding (
command As ICommand,
source As Object,
eventName As String,
Optional initialState As IDictionary(Of String, Object) = Nothing,
ParamArray targets As Object()
) As ICommandBinding
public:
[ExtensionAttribute]
static ICommandBinding^ CreateBinding(
ICommand^ command,
Object^ source,
String^ eventName,
IDictionary<String^, Object^>^ initialState = nullptr,
... array<Object^>^ targets
)
[<ExtensionAttribute>]
static member CreateBinding :
command : ICommand *
source : Object *
eventName : string *
?initialState : IDictionary<string, Object> *
targets : Object[]
(* Defaults:
let _initialState = defaultArg initialState null
*)
-> ICommandBinding
- command ICommand
- The command to bind.
- source Object
- The source, which can trigger the command. Can be a Type for static events.
- eventName String
- The name of the event on the source that can trigger the command.
- initialState IDictionaryString, Object (Optional)
- The initial state of the binding.
- targets Object
- Zero or more targets for the binding.
ICommandBindingAn
ICommandBinding instance, whose
State is initialized by the provided
initialState and to which the specified
source and
targets are bound.In Visual Basic and C#, you can call this method as an instance method on any object of type
ICommand. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).