Should be a simple one, but I can’t work out how to do it. Using WPF4 I want to Bind Ctrl + - to Zoom Out and Ctrl + = to Zoom In:
<KeyBinding Command="{Binding Content.ZoomInCommand}" Gesture="Ctrl+="/>
<KeyBinding Command="{Binding Content.ZoomOutCommand}" Gesture="Ctrl+-"/>
However, I’m getting errors: in the case of Ctrl + =:
Requested value ‘=’ was not found.
Any ideas?
Okay – it turns out that the = key does not exist (you can check this through the
Key-enumeration – there is no entry for Equal or EqualSign)… I use an international keyboard, so you have to find which key sequence you hit to enter = (for me it’s Shift + D0 on a danish keyboard) – and use that key-sequence.So your XAML should be (in Denmark):
EDIT: I believe on an American system it is the
OemPluskey – but you can check it by console-writeline’ing thee.Keyargument in a key-down event handler)EDIT2: the - key is
OemMinuson my system.