ButtonBase.Command 屬性

定義

取得或設定按下此按鈕後要叫用的命令。Gets or sets the command to invoke when this button is pressed.

public:
 property System::Windows::Input::ICommand ^ Command { System::Windows::Input::ICommand ^ get(); void set(System::Windows::Input::ICommand ^ value); };
[System.ComponentModel.Bindable(true)]
[System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)]
public System.Windows.Input.ICommand Command { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)>]
member this.Command : System.Windows.Input.ICommand with get, set
Public Property Command As ICommand

屬性值

ICommand

當按下這個按鈕時要呼叫的命令。A command to invoke when this button is pressed. 預設值是 nullThe default value is null.

屬性

備註

這個屬性是用來將命令與特定按鈕實例產生關聯。This property is used to associate a command with a particular button instance.

在中 Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML) ,這個屬性最常設定為其中一個現有命令程式庫(例如或)的靜態命令值 ApplicationCommands NavigationCommandsIn Extensible Application Markup Language (XAML)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. 如需詳細資訊,請參閱 命令總覽ICommandFor details, see Commanding Overview or ICommand.

XAML Attribute UsageXAML Attribute Usage

<object Command="commandName"/>  

XAML 值XAML Values

commandNamecommandName
要在按下此按鈕時叫用的命令。The command to invoke when this button is pressed.

相依性屬性資訊Dependency Property Information

識別碼欄位Identifier field CommandProperty
中繼資料屬性設定為 trueMetadata properties set to true None

適用於