ButtonBase.Command property

Applies to Windows and Windows Phone

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

Syntax


public:
property ICommand^ Command { 
   ICommand^ get();
   void set (ICommand^ value);
}


<button Command="commandReference"/>


XAML Values

commandReference

A reference to an ICommand implementation that describes the command logic. Typically this is done through a Binding reference to a data source, when using view-view model designs.

Property value

Type: System.Windows.Input.ICommand [.NET] | Windows::UI::Xaml::Input::ICommand [C++]

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

Remarks

The ICommand interface comes from a different source depending on whether the data source is implemented in C++ or for Microsoft .NET. C++ implements Windows::UI::Xaml::Input::ICommand. .NET implements System.Windows.Input.ICommand. Both interfaces have the same template. Which interface you call from your app code is analogous: use Windows::UI::Xaml::Input::ICommand for C++ code and System.Windows.Input.ICommand for .NET code.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls.Primitives
Windows::UI::Xaml::Controls::Primitives [C++]

Metadata

Windows.winmd

See also

ButtonBase

 

 

Show:
© 2014 Microsoft. All rights reserved.