Sdílet prostřednictvím


Button.Command Property

Definition

Gets or sets the command to invoke when the button is activated. This is a bindable property.

public System.Windows.Input.ICommand Command { get; set; }
member this.Command : System.Windows.Input.ICommand with get, set

Property Value

System.Windows.Input.ICommand

A command to invoke when the button is activated. The default value is null.

Remarks

This property is used to associate a command with an instance of a button. This property is most often set in the MVVM pattern to bind callbacks back into the ViewModel. IsEnabled is controlled by the Command if set.

Applies to