Freigeben über


DelegateCommand Class

Definition

Implementation of ICommand where the Execute and CanExecute callbacks are handled by delegates.

public ref class DelegateCommand : System::Windows::Input::ICommand
public ref class DelegateCommand : Microsoft::VisualStudio::PlatformUI::DelegateCommandBase, System::Windows::Input::ICommand
public class DelegateCommand : System.Windows.Input.ICommand
public class DelegateCommand : Microsoft.VisualStudio.PlatformUI.DelegateCommandBase, System.Windows.Input.ICommand
type DelegateCommand = class
    interface ICommand
type DelegateCommand = class
    inherit DelegateCommandBase
    interface ICommand
Public Class DelegateCommand
Implements ICommand
Public Class DelegateCommand
Inherits DelegateCommandBase
Implements ICommand
Inheritance
DelegateCommand
Inheritance
DelegateCommand
Implements

Constructors

DelegateCommand(Action, Func<Boolean>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action, Func<Boolean>)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

DelegateCommand(Action)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

DelegateCommand(Action<Object>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

DelegateCommand(Action<Object>, Predicate<Object>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action<Object>, Predicate<Object>)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action<Object>)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

Methods

CanExecute(Object)

Gets a value indicating whether this command is executable.

CanExecuteDependsOn(INotifyPropertyChanged, String)

Adds a property upon which this command's CanExecute state depends. When the property changes, this command will raise CanExecuteChanged

(Inherited from DelegateCommandBase)
Execute(Object)

Executes the command.

RaiseCanExecuteChanged()

Event called when the current command's ability to execute may have changed.

RaiseCanExecuteChanged()

Raises the CanExecuteChanged event.

(Inherited from DelegateCommandBase)

Events

CanExecuteChanged
CanExecuteChanged

An event that is fired when the executable state of this command changes. Call RaiseCanExecuteChanged to force listeners to update.

(Inherited from DelegateCommandBase)

Applies to