ButtonBase.Command ButtonBase.Command ButtonBase.Command ButtonBase.Command Property


Gets or sets the command to invoke when this button is pressed.

 property System::Windows::Input::ICommand ^ Command { System::Windows::Input::ICommand ^ get(); void set(System::Windows::Input::ICommand ^ value); };
public System.Windows.Input.ICommand Command { get; set; }
member this.Command : System.Windows.Input.ICommand with get, set
Public Property Command As ICommand

Property Value

A command to invoke when this button is pressed. The default value is null.


This property is used to associate a command with a particular button instance.

In Extensible Application Markup Language (XAML), this property is most often set to be a static command value from one of the existing command libraries, such as ApplicationCommands or NavigationCommands. For details, see Commanding Overview or ICommand.

XAML Attribute Usage

<object Command="commandName"/>  

XAML Values

The command to invoke when this button is pressed.

Dependency Property Information

Identifier field CommandProperty
Metadata properties set to true None

Applies to