I need MouseWheelZoomModifier to work only when I pressed mouse button. I wrote:
<s:MouseWheelZoomModifier ExecuteOn="MouseRightButton" />
But it all the same executing when I’m not pressing mouse button. Why?
- Denis Denis asked 6 years ago
- You must login to post comments
Hi Denis
MouseWheelZoomModifier ignores ExecuteOn (which is a property on ChartModifierBase). Think about it, it doesn’t make sense to see a user holding a mouse button AND the wheel at the same time…
What are you trying to achieve and why?
- Andrew Burnett-Thompson answered 6 years ago
-
My charts are within ScrollView, so when I scroll mouse wheel I want ScrollView to be scrolled.
-
Right, what you need to do then is ensure that ScrollView mouse events are passed to children when edge of scroll is reached. e.g. https://stackoverflow.com/questions/14348517/child-elements-of-scrollviewer-preventing-scrolling-with-mouse-wheel
-
I always holding mouse when scrolling. In any case, I myself want to decide use mouse holding or not. Could you provide supporting of ExecuteOn ?
-
No we’re not going to do that, but you are free to write your own class which inherits MouseWheelZoomModifier and override PerformZoom(). There is some information here: https://www.scichart.com/questions/question/mousewheelzoommodifier-and-zoom-completion-event
- You must login to post comments
I extended MouseWheelZoomModifier and override OnModifierMouseWheel:
public override void OnModifierMouseWheel(ModifierMouseArgs e) {
if (MatchesExecuteOn( e.MouseButtons, ExecuteOn )) {
base.OnModifierMouseWheel( e );
}
}
But e.MouseButtons always None. Why?
- Denis Denis answered 6 years ago
- last edited 6 years ago
-
because e.MouseButtons comes from the mouse event, which is a MouseWheel event, which has no buttons :) Try overriding OnModifierMouseDown/Up and storing e.MouseButtons there. Or use another way to detect if mouse button is down in WPF.
- You must login to post comments
Please login first to submit.