views:

142

answers:

1

I am using a custom panel as a ItemsPanel for a ItemsControl in a with a custom template that provides for a scroll viewer. (See Xaml below.) So long as my panel does not implement IScrollInfo, scrolling works in this scenerio.

I implement IScrollInfo and update my viewport and extent sizes in measure override. The scroll bar shows the correct relative size, and if I call the IScrollInfo methods directly, scrolling works as expected. However, the drag and flick gestures no longer scroll the content. Putting a breakpoint on the input of every IScrollInfo method shows that drag and pick are not calling the interface. Removing the IScrollInfo interface declaration restores the scroll on drag and flick behavior.

Is there a simple way to restore the flick and pan gestures to ItemControls with panels that implement IScrollInfo?

+1  A: 

An unfortunate answer I received from Eric Sink, A MSFT forum moderator.

I believe that what is happening is that, when you inherit from IScrollInfo, your panel takes over all of the scroll functionality but we use an internal interface, as martin mentioned, to control the flick animation. Since your object does not inherit from this interface the underlying code will bypass this functionality.

I think that you should still be able to override the OnManipulation* events and setup your own storyboard animation.

It sounds like if you want to do IScrollInfo, you're on your own for the manipulation.

John Melville