Hi,
I need to customize the zoom feature of the xamdatachart.The zoom with the mouse-wheel should behave as following:
- only horizontally as default
- only vertically when Control-Key is pressed down.
I tried to react to KeyDown, KeyUp and MouseLeaveFocus Events in order to set the VerticalZoomable and HorizontalZoomable Properties but the KeyDown and KeyUp events are never triggered. Neither are PreviewKeyDown and PreviewKeyUp. So I really don't now how to achieve this behavior.
need help,
Thank you in advance,
Jerome RG
Hi Jerome,
I'm looking into this for you and will post back here when I have more information
You mentioned that you were looking for events. You should be able to trap the PreviewKeyUp and the PreviewKeyDown events.
Adding this line of codeup to the += and then tabbing will generate the new event handle as a stub that you can use. And will generate the right arguments in the event handlers, if that is an issue.
xmDataChart.PreviewMouseWheel += new MouseWheelEventHandler(xmDataChart_PreviewMouseWheel);
I was able to achieve what I think you need by controlling the chart’s HorizontalZoomable and VerticalZoomable properties depending on what key had be pressed or released, using the PreviewKeyUp and PreviewKeyDown events.
If you continue to have issue, it would be helpful if you could attach a small sample.
I guess I didn't understand your question. I thought you couldn’t find any events to control the navigation behavior.
Craig has a forum post concerning creating extension methods for navigating the xamDataChart
http://community.infragistics.com/silverlight/articles/extension-methods-for-navigating-the-xamdatachart.aspx
There is also a link to his video where he explains the same issue. But in both you will see what is necessary to control the navigation behavior.
Let me know if you have any further questions.
Thank you, but I know how to attach an event handler.
The issue is to configure the zoom - for example just horizontally, or just vertically or the zooming speed - with ctrl+wheel, shift+wheel, or alt+wheel and so on...
And for that I only found unsatisfactory tricky ways.
Please help me finding a good way to achieve that,
Jerome