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: 1.0.68.0
Syntax
public class NullCommand : ICommand

The NullCommand type exposes the following members.

Constructors
  NameDescription
Public methodNullCommand
Initializes 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.

[NotNull]

Top
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
Remarks
Useful as fallback for command bindings, since a binding to null will leave the bound control enabled.
See Also