Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
990
Scrolling on drag?
posted

Is there a cool way to make the carousel scroll it's content in response to mouse dragging on an item? So that you can use the control a bit like Cover Flow on an iPhone?? (if you're a patent lawyer, please look away!)

 John

Parents
  • 8576
    Offline posted
    Hi John -
     
    You can cause the Carousel to scroll by calling the various scrolling methods on the exposed ScrollInfo object.  For example:
     
    myCarousel.ScrollInfo.LineLeft();
     
    By calling the appropriate ScrollInfo method depending on the direction the user is dragging the item and how far they have dragged the item, you should be able to simulate the behavior you are looking for.
     
    Joe Modica
Reply Children
  • 8576
    Offline posted in reply to John
    Hi John -
     
     
     
    BTW - I thought of another option for you to trigger carousel scrolling via mouse movement.  In the 7.2 release we have a MousePanningDecorator element that you can use to provide 'middle-button' mouse panning for any scrollable control.  Simply place the MousePanningDecorator element somewhere above (in the visual tree) the control you want to scroll.  The when the user clicks the middle mouse button over the control, the MousePanningDecorator takes care of displaying the mouse panning glyphs on the screen and automatically scrolling the control as the mouse is moved (as long as you have a ScrollViewer in the template of the control you want to scroll).
     
    This is definitely a different UI scenario than the one you are looking to implement (i.e., dragging an item to initiate the scroll) but I thought you might find it interesting (and it's painless to implement :-) )
     
    Joe Modica