SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

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

Last post 03-28-2017 3:14 PM by cybernoid. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-28-2017 3:14 PM

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

    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.



Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this ( email address.