Edytuj

Udostępnij za pośrednictwem


RelayCommand Class

Definition

A command whose sole purpose is to relay its functionality to other objects by invoking delegates. The default return value for the CanExecute(Object) method is true. This type does not allow you to accept command parameters in the Execute(Object) and CanExecute(Object) callback methods.

public sealed class RelayCommand : Microsoft.Toolkit.Mvvm.Input.IRelayCommand, System.Windows.Input.ICommand
type RelayCommand = class
    interface IRelayCommand
    interface ICommand
Public NotInheritable Class RelayCommand
Implements ICommand, IRelayCommand
Inheritance
RelayCommand
Implements

Constructors

RelayCommand(Action, Func<Boolean>)

Initializes a new instance of the RelayCommand class.

RelayCommand(Action)

Initializes a new instance of the RelayCommand class that can always execute.

Methods

CanExecute(Object)
Execute(Object)
NotifyCanExecuteChanged()

Notifies that the CanExecute(Object) property has changed.

Events

CanExecuteChanged

Applies to