MenuFlyoutItem.Command 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當物品被按下時,會接收或設定呼叫指令。
public:
property ICommand ^ Command { ICommand ^ get(); void set(ICommand ^ value); };
ICommand Command();
void Command(ICommand value);
public ICommand Command { get; set; }
var iCommand = menuFlyoutItem.command;
menuFlyoutItem.command = iCommand;
Public Property Command As ICommand
<MenuFlyoutItem Command="commandReference"/>
屬性值
當物品被按下時的呼叫指令。 預設是 null。
備註
ICommand 介面的來源會根據資料來源是以 C++ 實作還是為 Microsoft .NET 實作而有所不同。 C++ 是實作 Microsoft 的。UI。Xaml.Input.ICommand。 Microsoft .NET 實作 System.Windows。輸入。ICommand。 兩個介面使用相同的範本。 你從應用程式程式碼中呼叫哪個介面類似:使用 Microsoft。UI。Xaml.Input.ICommand 用於 C++ 程式碼與 System.Windows。Input.ICommand 用於Microsoft .NET程式碼。
XAML 語法顯示為 Microsoft .NET 的 System.Windows。Input.ICommand 型別無法在 Windows 執行階段 XAML 上運作。 你應該一定要用 Binding 參考。 不支援命名指令和 x:static 等結構。