Click here to Skip to main content
15,616,191 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a list of items inside windows 8.1 listview what I wanted to do is, on a button click I like to auto scroll the items inside list view.

<ListView x:Name="OnboardPanel" HorizontalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Hidden">
                    <ItemsWrapGrid x:Name="OnboardWrapGrid" MaximumRowsOrColumns="6" Orientation="Horizontal" HorizontalAlignment="Stretch" removed="Red"/>
                    <Image Source="{Binding ImageName}" Margin="1" Stretch="UniformToFill"/>

my code behind is as follows

private void Button_Click(object sender, RoutedEventArgs e)
           Storyboard storyboard1 = new Storyboard();
           DoubleAnimation verticalScrollOffsetAnimation = new DoubleAnimation
               From = 0,
               To = 1000,
               Duration = new TimeSpan(0, 0, 0, 3, 0),
               EnableDependentAnimation = true

           Storyboard.SetTarget(verticalScrollOffsetAnimation, OnboardPanel.GetScrollViewer());
           Storyboard.SetTargetProperty(verticalScrollOffsetAnimation, "VerticalOffset");
           //storyboard1.FillBehavior = FillBehavior.Stop;
           //storyboard1.RepeatBehavior = RepeatBehavior.Forever;

What I have tried:

I was able to achieve this if I add those items inside stackpanel and wrapped it within scrollviewer control. But I was unable to animate the inbuilt scrollviewer of the listview.

So Is it possible to animate listview / gridview's default scrollviewer using storyboard in W8.1 store app.
Updated 28-Feb-16 22:45pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900