ButtonBase::Command Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

property ICommand^ Command {
	virtual ICommand^ get() sealed;
	virtual void set(ICommand^ value) sealed;

Property Value

Type: System.Windows.Input::ICommand^

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.

<object Command="commandName"/>


The command to invoke when this button is pressed.

Identifier field


Metadata properties set to true


.NET Framework
Available since 3.0
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Return to top