0
votes

I've got a Silverlight 4 custom control that basically is several Canvas elements wrapped inside a ScrollViewer. The user can set a property to determine whether to scroll or zoom when using their mouses wheel. In the custom control's MouseWheel event, I check to see if they want to scroll or zoom. If zooming, I determine the delta and modify the custom control's zoom level (which then handles the zooming code for me).

The problem is that zooming won't start until the ScrollViewer's current position of the vertical scrollbar is at the top or bottom of the scrollbar. Once their, then the zooming works perfectly.

Does anyone have any suggestions on how I can prevent scrolling completely so that I only zoom (when the user wants to zoom, that is)?

Thanks!

1
To further deepen the mystery, I'm seeing that the control's MouseWheel event doesn't even fire until after the scroll bar is that max or min height. Same for the ScrollViewer control. I'm wondering if this is new behavior from Silverlight 4. I did not see this in SL3. - beaudetious
There should be a badge for answering your own questions. I do that with alarming regularity. - beaudetious

1 Answers

0
votes

Looks like one of my child elements was hogging the MouseWheel event. I traced this by adding Debug.WriteLine statements to each of the child element's MouseWheel event as well as the parent control's MouseWheel event.

So, I can't blame SL4. Just myself. :)