Пример #1
0
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            // Hide the refresh indicator (SV1 is the outer ScrollViewer)
            SV1.ChangeView(null, 100, null);



            ScrollViewer childScrollView = GetChildElement <ScrollViewer>(lv);

            if (childScrollView != null)
            {
                CompositionPropertySet scrollingProperties = ElementCompositionPreview.GetScrollViewerManipulationPropertySet(childScrollView);
                Compositor             comp = scrollingProperties.Compositor;


                //
                // Set up the animation on the content of the main scroller.  Animation will show a peek
                // of the refresh indicator when the child listview is bouncing.
                //
                MyPanel             tempGrid         = GetChildElement <MyPanel>(SV1);
                Visual              elementVisual    = ElementCompositionPreview.GetElementVisual(tempGrid);
                ExpressionAnimation elementAnimation = comp.CreateExpressionAnimation(@" max(scrollingProperties.Translation.Y, 0)");
                elementAnimation.SetReferenceParameter("scrollingProperties", scrollingProperties);
                elementVisual.StartAnimation("Offset.Y", elementAnimation);

                //
                // Setup the animation to negate the bounce on the listView's scroller
                //
                Visual childVisual = ElementCompositionPreview.GetElementVisual(childScrollView);
                ExpressionAnimation childAnimation = comp.CreateExpressionAnimation(@" -max(scrollingProperties.Translation.Y, 0)");
                childAnimation.SetReferenceParameter("scrollingProperties", scrollingProperties);
                childVisual.StartAnimation("Offset.Y", childAnimation);
            }
        }
Пример #2
0
 private void UpdateFeed()
 {
     for (int i = lastValue; i > lastValue - 10; i--)
     {
         feed.Insert(0, i);
     }
     lastValue = lastValue - 10;
     if (lastValue < 0)
     {
         PopulateFeed();
     }
     SV1.ChangeView(null, 0, null, true);
     VisualStateManager.GoToState(this, "PullToRefresh", false);
 }
Пример #3
0
 private void InnerCustomPanel_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     SV1.ChangeView(null, 100.0, null, true);
 }
Пример #4
0
 private void MainPage_Loaded(object sender, RoutedEventArgs e)
 {
     // Hide the refresh indicator
     SV1.ChangeView(null, 100, null);
 }