MenuFlyoutItem.Command property

Applies to Windows and Windows Phone

Gets or sets the command to invoke when the item is pressed.

Syntax


public ICommand Command { get; set; }


<MenuFlyoutItem 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 model-view-view model designs.

Property value

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

The command to invoke when the item is pressed. The default is null.

Remarks

The ICommand interface comes from a different source depending on whether the data source is implemented in Visual C++ component extensions (C++/CX) or for Microsoft .NET. C++/CX 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++/CX code and System.Windows.Input.ICommand for .NET code.

The XAML syntax shown for .NET's System.Windows.Input.ICommand type does not work for Windows Runtime XAML. You should always use a Binding reference. Constructs such as named commands and x:Static are not supported.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

See also

MenuFlyoutItem

 

 

Show:
© 2014 Microsoft