UIElement.InputBindings UIElement.InputBindings UIElement.InputBindings UIElement.InputBindings Property

定義

取得與此元素關聯的輸入繫結集合。Gets the collection of input bindings associated with this element.

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

屬性值

輸入繫結的集合。The collection of input bindings.

範例

下列範例會填入這個屬性上Window,以單一KeyBindingThe following example populates this property on a Window, with a single KeyBinding.

<Window.InputBindings>
  <KeyBinding Key="B"
              Modifiers="Control" 
              Command="ApplicationCommands.Open" />
</Window.InputBindings>

如需詳細資訊XAMLXAML語法的集合,請參閱XAML 語法詳細資料For more information about the XAMLXAML syntax for collections, see XAML Syntax In Detail.

備註

輸入繫結支援命令與輸入裝置繫的結。Input bindings support the binding of commands to input devices. 比方說,MouseBinding實作輸入繫結包含滑鼠裝置特定的屬性。For example, MouseBinding implements input bindings that include properties that are particular to mouse devices.

輸入繫結的集合會包含屬於此類型的輸入繫結以及宣告執行個體的輸入繫結。The collection of input bindings will include both input bindings that pertain to the type as well as input bindings that are declared on the instance.

相關的屬性, CommandBindings,維護命令繫結的集合。A related property, CommandBindings, maintains a collection of command bindings. 這些不同於輸入繫結,因為它們代表的下一個層級的命令處理動作繫結至已知的命令所示。These differ from input bindings in that they represent the next level down of command processing - actions that are tied to known commands.

XAML 屬性項目用法XAML Property Element Usage

<object>  
  <object.InputBindings>  
    oneOrMoreInputBindings  
  </object.InputBindings>  
</object>  

XAML 值XAML Values

oneOrMoreInputBindingsoneOrMoreInputBindings
一或多個InputBinding項目 (通常KeyBindingMouseBinding衍生的類別)。One or more InputBinding elements (typically the KeyBinding or MouseBinding derived classes). 每一種應該要有CommandGesture屬性設定。Each of these is expected to have a Command and Gesture attribute set.

適用於

另請參閱