Questions tagged [inputbinding]

79 questions
25
votes
6 answers

KeyBinding in UserControl doesn't work when TextBox has the focus

The following situation. I've got a UserControl with five keybindings. When the TextBox has the focus the keybindings of the UserControl stop firing.. Is there a way to fix this 'problem'?
Ralf de Kleine
  • 11,464
  • 5
  • 45
  • 87
23
votes
2 answers

Defining InputBindings within a Style

I'm creating a WPF app using the MVVM design pattern, and I'm trying to extend the TabItem control so that it closes the tab when the user clicks the middle mouse button. I'm trying to achieve this using InputBindings, and it works very well until I…
Brent
  • 1,743
  • 3
  • 16
  • 27
11
votes
5 answers

InputBindings work only when focused

I have designed a reuseable usercontrol. It contains UserControl.InputBindings. It is quite simple as it only contains a label and a button (and new properties etc.) When I use the control in my window it works well. But the key binding only works…
ZoolWay
  • 5,411
  • 6
  • 42
  • 76
8
votes
2 answers

KeyBinding on a TreeViewItem

I have a typical treeview and a viewmodel. The viewmodel has an observable collection of other viewmodels that serves as a data source for the tree. public class TreeViewVM { public ObservableCollection Items { get; private set; } …
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
7
votes
1 answer

How to remove input binding added through CommandManager.RegisterClassInputBinding?

I used CommandManager.RegisterClassInputBinding to add binding to the whole type. Now I want to remove it. This is what I tested. private void CommandBinding_Executed_1(object sender, ExecutedRoutedEventArgs e) { …
Sergej Andrejev
  • 9,091
  • 11
  • 71
  • 108
7
votes
1 answer

Define InputBindings in Style

I would like to add a right click and left click command to each ListBoxItem in a Style. Is this possible?