Click or drag to resize

NullCommand Class

A ICommand implementation that does nothing and can't be executed.
Inheritance Hierarchy
SystemObject
  TomsToolbox.WpfNullCommand

Namespace: TomsToolbox.Wpf
Assembly: TomsToolbox.Wpf (in TomsToolbox.Wpf.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class NullCommand : ICommand

The NullCommand type exposes the following members.

Constructors
 NameDescription
Public methodNullCommandInitializes a new instance of the NullCommand class
Top
Methods
 NameDescription
Public methodCanExecute Defines the method that determines whether the command can execute in its current state.
Public methodExecute Defines the method to be called when the command is invoked.
Top
Events
 NameDescription
Public eventCanExecuteChanged Occurs when changes occur that affect whether or not the command should execute.
Top
Fields
 NameDescription
Public fieldStatic memberDefault The singleton instance of the command.
Top
Extension Methods
 NameDescription
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions)
Top
Remarks
Useful as fallback for command bindings, since a binding to null will leave the bound control enabled.
See Also