Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

AvalonEditor and handle input binding for MouseWheel up/down + Ctrl key

$
0
0

Application has main window which contains toolbar, preview control and AvalonEdit control.

Would like to handle MouseWhell up/down + Ctrl key when mouse is above AvalonEdit control. Then I would execute commands to zoom in and zoom out of text editor text (I do "zoom" in and out by changing fontsize of editor control in my MVVM).

I have following input bindings on main window:

<MouseBinding Gesture="{inputmouse:MouseWheel Direction=Up, Keys=Control}" Command="{Binding MouseWhellUpCommand}" />
<MouseBinding Gesture="{inputmouse:MouseWheel Direction=Down, Keys=Control}" Command="{Binding MouseWhellDownCommand}" />

Following input bindings are handled and commands are executed everywhere in main window - except above AvalonEdit text control.

By looking at UISnoop and WPF Inspector I can see that events are already handled by AvalonEdit so they do not bubble up to my handlers on window.

Have even tried to move mouse bindings to AvalonEdit control itself but events still do not reach command handlers.

Should I maybe use PreviewMouseWheel or should I sub class AvalonEdit control (then what should I override?) ...

Right now - I'm little bit out of ideas how to solve this issue and I would need help.

 

 


Viewing all articles
Browse latest Browse all 1764

Trending Articles