ButtonBase.CommandTarget 屬性

定義

取得或設定引發指定命令的元素。Gets or sets the element on which to raise the specified command.

public:
 property System::Windows::IInputElement ^ CommandTarget { System::Windows::IInputElement ^ get(); void set(System::Windows::IInputElement ^ value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.IInputElement CommandTarget { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.CommandTarget : System.Windows.IInputElement with get, set
Public Property CommandTarget As IInputElement

屬性值

IInputElement

要在其上引發命令的項目。Element on which to raise a command.

屬性

備註

CommandTarget屬性不能用來定義 UIElementThe CommandTarget property cannot be used to define a UIElement. CommandTarget屬性會提供已在應用程式中某處定義之元素的參考。The CommandTarget property provides a reference to an element that is already defined somewhere in your application.

XAML Attribute UsageXAML Attribute Usage

<ButtonBase CommandTarget="{Binding ElementName= elementName }"/>  

XAML 值XAML Values

elementNameelementName
IInputElement接收命令的名稱。The name of IInputElement that receives the command.

相依性屬性資訊Dependency Property Information

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

適用於

另請參閱