3
votes

In my current project i have a scroll viewer that has several buttons listed. Instead of navigating trough the standard scrollbar navigation buttons are used instead.

So what i wish to achieve is when i press a navigation button (repeat button) the next button / item in line directly pops up.

With the default behaviour i see the content slowly appearing when i press the navigation button.

When i click next or previous on the navigation i want to see the next item in line instantly appearing insteed of waiting for example 2 sec until the scrolling is done.

Inside the scrollviewer is a itemsControl that contains a stackpanel with custom created buttons.

The scrollviewer is on its turn located in a grid.

Or is a scrollviewer not the way to go to navigate between items in a stackpanel by means of 2 navigation buttons?

EDIT: For some reason logical scrolling seems not to be working anymore after applying a itemControl where the stackpanel and the button datatemplate is located.

Thanks in advance! Jackz

1

1 Answers

3
votes

This behavior is called logical scrolling. To enable it, you have to put your ScrollViewer in a StackPanel and set the ScrollViewer's "CanContentScroll" property to true.

Here you find more info.