 | CommandSourceFactoryTReplace Method |
Replaces the specified old command with the new command, preserving it's position in the command stack.
Namespace: TomsToolbox.Wpf.CompositionAssembly: TomsToolbox.Wpf.Composition (in TomsToolbox.Wpf.Composition.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntaxpublic T Replace(
Object? context,
ICommand oldCommand,
ICommand newCommand
)
Public Function Replace (
context As Object,
oldCommand As ICommand,
newCommand As ICommand
) As T
Parameters
- context Object
- The context.
- oldCommand ICommand
- The old command.
- newCommand ICommand
- The new command.
Return Value
TThe
CommandSource associated with the
context
ExceptionsException | Condition |
---|
ArgumentException | Can't replace a command that has not been attached before;oldCommand |
See Also