ContentElement.CommandBindings 属性

定义

获取与此元素关联的 CommandBinding 对象的集合。Gets a collection of CommandBinding objects that are associated with this element.

public:
 property System::Windows::Input::CommandBindingCollection ^ CommandBindings { System::Windows::Input::CommandBindingCollection ^ get(); };
public System.Windows.Input.CommandBindingCollection CommandBindings { get; }
member this.CommandBindings : System.Windows.Input.CommandBindingCollection
Public ReadOnly Property CommandBindings As CommandBindingCollection

属性值

CommandBindingCollection

所有 CommandBinding 对象的集合。The collection of all CommandBinding objects.

注解

CommandBinding允许命令处理此元素的特定命令,并声明命令、其事件和由此元素附加的处理程序之间的链接。A CommandBinding enables command handling of a specific command for this element and declares the linkage between a command, its events, and the handlers that are attached by this element.

填充集合的另一种典型方法 CommandBindings 是以 CommandManager 编程方式使用方法。Another typical way to populate the CommandBindings collection is to use CommandManager methods programmatically.

XAML 属性元素用法XAML Property Element Usage

<object>  
  <object.CommandBindings>  
    oneOrMoreCommandBindings  </object.CommandBindings>  
</object>  

XAML 值XAML Values

oneOrMoreCommandBindingsoneOrMoreCommandBindings
一个或多个 CommandBinding 元素。One or more CommandBinding elements. 其中每个都应将 Command 属性设置为已知命令,并为 CanExecuteExecuted 处理程序实现设置特性。Each of these should have a Command attribute set to a known command, and attributes set for the CanExecute and Executed handler implementations. 有关更多信息,请参见CommandBindingFor more information see CommandBinding.

适用于

另请参阅