Inheritance: IScrollViewerViewChangedEventArgs
Ejemplo n.º 1
0
 private void Control_ViewChanged(object sender, Windows.UI.Xaml.Controls.ScrollViewerViewChangedEventArgs e)
 {
     if (!e.IsIntermediate)
     {
         (Element as Ao3TrackReader.Controls.ScrollView).SetScrollEnd();
     }
 }
        private async void Products_OnScrollViewerViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            Domain.ViewModels.Search vm = (Domain.ViewModels.Search)this.DataContext;
            ScrollViewer sv = (ScrollViewer)sender;

            if (!vm.IsLoading)
            {
                var verticalOffset = sv.VerticalOffset;
                var maxVerticalOffset = sv.ExtentHeight - sv.ViewportHeight;

                if (maxVerticalOffset < 0 ||
                    verticalOffset == maxVerticalOffset)
                {
                    // Scrolled to bottom
                    if (vm.Products.Count > 18)
                        await vm.MoreProducts();

                }
                else
                {
                    // Not scrolled to bottom
                    // rect.Fill = new SolidColorBrush(Colors.Yellow);
                }

            }
        }
Ejemplo n.º 3
0
 private void _scrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     if (!e.IsIntermediate) // scroll completed
     {
         Debug.WriteLine(_itemsWrapGrid?.FirstVisibleIndex);
     }
 }
Ejemplo n.º 4
0
 private static void TypedSender_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     ScrollViewer typedSender = (ScrollViewer)sender;
     if (Abs(typedSender.HorizontalOffset - LastOffsets[typedSender].Item2) > 5)
         LastOffsets[typedSender] = new Tuple<double, double>(LastOffsets[typedSender].Item2, typedSender.HorizontalOffset);
     if (!e.IsIntermediate)
     {
         List<double> snapOffsets = new List<double>();
         double snap = GetSnapInterval(typedSender);
         double offset = typedSender.HorizontalOffset;
         for (double i = 0; i < typedSender.ScrollableWidth; i += snap)
         {
             snapOffsets.Add(i);
         }
         snapOffsets.Add(typedSender.ScrollableWidth);
         double newOffset;
         if (offset > typedSender.ScrollableWidth)
             newOffset = typedSender.ScrollableWidth;
         else if (offset < 0)
             newOffset = 0;
         else if (LastOffsets[typedSender].Item2 - LastOffsets[typedSender].Item1 > 0)
             newOffset = snapOffsets.First(off => off >= offset);
         else
             newOffset = snapOffsets.Last(off => off <= offset);
         ((ScrollViewer)typedSender).ChangeView(newOffset, null, null, false);
     }
 }
        private void ScrollViewer_Vertical_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            var verticalOffset = _scrollViewer.VerticalOffset;
            var maxVerticalOffset = _scrollViewer.ScrollableHeight;

            CallCommandIfEndReached(verticalOffset, maxVerticalOffset);
        }
        private void _outerSv_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            var sv = sender as ScrollViewer;


            if (sv.VerticalOffset == 0.0f)
                textBlock1.Opacity = 1;
            else
                textBlock1.Opacity = 0.3f;

            if (sv.VerticalOffset != 0.0f)
                _isPullRefresh = true;

            if (!e.IsIntermediate)
            {
                if (sv.VerticalOffset == 0.0f && _isPullRefresh)
                {
                    Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        _galleryList.ClearValue(ListView.SelectedItemProperty);
                        AppPCL.MainVM.OnNeedToGoBack();
                    });
                }
                _isPullRefresh = false;
                //sv.ChangeView(null, 60.0f, null);
            }
        }
Ejemplo n.º 7
0
 private void MainScrollViewerOnViewChanged(object sender, ScrollViewerViewChangedEventArgs scrollViewerViewChangedEventArgs)
 {
     if (MainScrollViewer.HorizontalOffset >= MainScrollViewer.ScrollableWidth - 100 && !isLoading)
     {
         LoadMore();
     }
 }
 private void ViewerOnViewChanged(object sender, ScrollViewerViewChangedEventArgs scrollViewerViewChangedEventArgs)
 {
     ScrollViewer view = (ScrollViewer)sender;
     double progress = view.VerticalOffset / view.ScrollableHeight;
     if (progress > 0.7 && LoadCommand != null && LoadCommand.CanExecute(null))
     {
         LoadCommand.Execute(null);
     }
 }
 private void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     ScrollViewer sv = sender as ScrollViewer;
     if (sv.VerticalOffset == 0)
     {
         SV1.DirectManipulationCompleted += SV1_DirectManipulationCompleted;
         VisualStateManager.GoToState(this, "Refreshing", false);
     }
 }
        private void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            ScrollViewer sv = sender as ScrollViewer;
            if (sv.VerticalOffset == 0)
            {
                timer.Start();
                VisualStateManager.GoToState(this, "Refreshing", false);
            }

        }
Ejemplo n.º 11
0
        private void OnScrollViewerViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            var verticalOffset = sv.VerticalOffset;
            var maxVerticalOffset = sv.ScrollableHeight;

            if (maxVerticalOffset < 0 || verticalOffset == maxVerticalOffset)
            {
                VideoGetNextPage();
            }
        }
Ejemplo n.º 12
0
 private void SV_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     var sV = (ScrollViewer)sender;
     if (verticalOffset > 0 && sV.VerticalOffset == 0)
     {
         // offset hasn't moved
         sV.ChangeView(null, verticalOffset, null, true);
     }
     verticalOffset = sV.VerticalOffset;
 }
Ejemplo n.º 13
0
        private async void sChanged(object sender, ScrollViewerViewChangedEventArgs sve)
        {
            await Task.Run(async() =>
            {
                ScrollViewer sv = (ScrollViewer)sender;
                //Debug.WriteLine(sv.ScrollableHeight + " , " + sv.VerticalOffset);

                if (sv.VerticalOffset >= sv.ScrollableHeight - 2000 && !loading)
                {
                    loading = true;
                    /*App.Progress.IsActive = true;
                    App.Progress.Visibility = Windows.UI.Xaml.Visibility.Visible;*/

                    FacebookClient _fb = new FacebookClient(session.accessToken);
                    dynamic parameters = new ExpandoObject();
                    parameters.access_token = session.accessToken;
                    dynamic result = null;

                    try
                    {
                        result = await _fb.GetTaskAsync(nextPage, parameters);
                    }
                    catch (FacebookOAuthException e)
                    {
                        Debug.WriteLine("Problem: " + e.StackTrace);
                        /*App.Progress.IsActive = false;
                        App.Progress.Visibility = Windows.UI.Xaml.Visibility.Collapsed;*/
                        loading = false;
                        return;
                    }

                    var friendResult = (IDictionary<string, object>)result;
                    var data = (IEnumerable<object>)friendResult["data"];

                    foreach (var item in data)
                    {
                        var posts = (IDictionary<string, object>)item;
                        await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            FacebookPost post = new FacebookPost(posts, session.userSession);
                            feedStack.Children.Add(post);
                        });

                    }

                    Debug.WriteLine(friendResult + "\n\n" + nextPage);

                    nextPage = (String)((IDictionary<string, object>)friendResult["paging"])["next"];

                    /*App.Progress.IsActive = false;
                    App.Progress.Visibility = Windows.UI.Xaml.Visibility.Collapsed;*/
                    loading = false;
                }
            });
        }
 private void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     ScrollViewer scrollviewer = (ScrollViewer)sender;
     if (scrollviewer.VerticalOffset >= scrollviewer.ScrollableHeight)
     {
         if (_ArchivedTaskViewModel.Hasmoretasks)
         {
             _ArchivedTaskViewModel.LoadArchviedTasks();
         }
     }
 }
Ejemplo n.º 15
0
 private async void Viewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     ScrollViewer view = (ScrollViewer)sender;
     double progress = view.VerticalOffset / view.ScrollableHeight;
     if(progress > 0.9 && !isLoadingNewsFeed)
     {
         isLoadingNewsFeed = true;
         offset = NewsFeedList.Items.Count;
         await getNewsFeed();
     }
 }
Ejemplo n.º 16
0
 private void svMarket_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     if(svMarket.VerticalOffset == 0)
     {
         MarketVm.LoadMoreMarket(TYPEGET.MORE, TYPE.NEW);
     }
     else if (svMarket.VerticalOffset >= svMarket.ScrollableHeight)
     {
         MarketVm.LoadMoreMarket(TYPEGET.MORE);
     }
 }
 private void ScrollViewer_ViewChanged(object sender, Windows.UI.Xaml.Controls.ScrollViewerViewChangedEventArgs e)
 {
     if (e.IsIntermediate)
     {
         ((EnhancedListView)Element).OnScrolling(this, EventArgs.Empty);
     }
     else
     {
         ((EnhancedListView)Element).OnScrolled(this, EventArgs.Empty);
     }
 }
Ejemplo n.º 18
0
 private void VGrid_ViewChanged( object sender, ScrollViewerViewChangedEventArgs e )
 {
     if( VGrid.HorizontalOffset == 0 && VGrid.VerticalOffset == 0 )
     {
         MainSplitView.OpenPane();
     }
     // This is to avoid internal code calling
     else if( MainSplitView.State == PaneStates.Opened )
     {
         MainSplitView.ClosePane();
     }
 }
Ejemplo n.º 19
0
		private void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
		{			
			if (scrollvComentLst.VerticalOffset >= scrollvComentLst.ScrollableHeight)
			{
				if (CommentVm != null)
					CommentVm.GetCommentOfStore(TYPEGET.MORE);
			}
			else if (scrollvComentLst.VerticalOffset == 0)
			{
				if (CommentVm != null)
					CommentVm.GetCommentOfStore(TYPEGET.MORE, TYPE.NEW);
			}
		}
Ejemplo n.º 20
0
 private void svNewProduct_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     if (svNewProduct.HorizontalOffset == 0)
     {
         if (ProStatisticVm != null)
             ProStatisticVm.GetNewProductList(TYPEGET.MORE, TYPE.NEW);
     }
     else if (svNewProduct.HorizontalOffset >= svNewProduct.ScrollableWidth)
     {
         if (ProStatisticVm != null)
             ProStatisticVm.GetNewProductList(TYPEGET.MORE);
     }
 }
Ejemplo n.º 21
0
 private void svProduct_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     if(svProduct.VerticalOffset == 0)
     {
         if (ProductVm != null)
             ProductVm.LoadProductsOfStoreOwner(TYPEGET.MORE, TYPE.NEW);
     }
     else if(svProduct.VerticalOffset >= svProduct.ScrollableHeight)
     {
         if (ProductVm != null)
             ProductVm.LoadProductsOfStoreOwner(TYPEGET.MORE);
     }
 }
Ejemplo n.º 22
0
 private void svSales_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     if(svSales.VerticalOffset == 0)
     {
         if (AdVm != null)
             AdVm.GetSaleOfOwner(TYPEGET.MORE, TYPE.NEW);
     }
     else if(svSales.VerticalOffset >= svSales.ScrollableHeight)
     {
         if (AdVm != null)
             AdVm.GetSaleOfOwner(TYPEGET.MORE);
     }
 }
        private void SvFollower_OnViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            // Laad nieuwe items in wanneer scrollviewer op einde is...
            _verticalOffsetFollower = SvFollower.VerticalOffset;
            _maxVerticalOffsetFollower = SvFollower.ScrollableHeight;

            if (_maxVerticalOffsetFollower < 0 || _verticalOffsetFollower == _maxVerticalOffsetFollower)
            {
                if (_bwFollower.IsBusy == false)
                {
                    _bwFollower.RunWorkerAsync();
                }
            }
        }
        private void SvPlaylist_OnViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            // Laad nieuwe items in wanneer scrollviewer op einde is ...
            _verticalOffsetPlaylist = SvPlaylist.VerticalOffset;
            _maxVerticalOffsetPlaylist = SvPlaylist.ScrollableHeight;

            if (_maxVerticalOffsetPlaylist < 0 || _verticalOffsetPlaylist == _maxVerticalOffsetPlaylist)
            {
                if (_bwPlaylist.IsBusy == false)
                {
                    _bwPlaylist.RunWorkerAsync();
                }
            }
        }
        private void Sv_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            //var myscrollbarScrollViewer = sender as ScrollViewer;

            //if (myscrollbarScrollViewer != null)
            //{
            var verticalOffsetValue = sv.VerticalOffset;
            var maxVerticalOffsetValue = sv.ExtentHeight - sv.ViewportHeight;
            if (maxVerticalOffsetValue < 0 || Math.Abs(verticalOffsetValue - maxVerticalOffsetValue) < 1.0)
            {
                Debug.WriteLine("Scroll offset: {0}", Math.Abs(verticalOffsetValue - maxVerticalOffsetValue), null);
                OnLoadMore();
            }
            //}
        }
Ejemplo n.º 26
0
        void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            var offset = (Math.Round(this.ScrollViewer.HorizontalOffset, 1) + 0.5) - 2;
            var index = (int)offset;

            if (TargetIndex.HasValue)
            {
                if (index != TargetIndex) return;
                TargetIndex = null;
            }

            if (this.SelectedIndex != index)
            {
                this.SelectedIndex = index;
            }
        }
Ejemplo n.º 27
0
 private void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     if (this.ScrollViewer.HorizontalOffset == 0)
     {
         StretchingPanel.Stretch(true);
         ShiftOver(true);
     }
     else
     {
         if (TranslateTransSemnatic.X > 0)
         {
             StretchingPanel.Stretch(false);
             ShiftOver(false);
         }
     }
 }
Ejemplo n.º 28
0
 private void svMessage_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 { 
     if(svMessage.VerticalOffset == 0)
     {
         if (MessageVm != null)
         {                    
             MessageVm.LoadInboxHitory(TYPEGET.MORE);
         }
     }
     else if(svMessage.VerticalOffset >= svMessage.ScrollableHeight)
     {
         //if (MessageVm != null)
         //{                    
         //    MessageVm.LoadInboxHitory(TYPEGET.MORE, TYPE.NEW);
         //}
     }
 }
Ejemplo n.º 29
0
        private void MainPage_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            MoviesPageViewModel vm = DataContext as MoviesPageViewModel;
            ScrollViewer view = (ScrollViewer)sender;
            double progress = view.VerticalOffset / view.ScrollableHeight;

            if ((view.VerticalOffset - PreviousVerticalOffset) > (vm.PageHeight / 2) && !vm.Endoflist)
            {
                PreviousVerticalOffset = view.VerticalOffset;
                vm.AddImageToList();
            }
            if (progress > 0.7 && !vm.Endoflist)
            {
                vm.Endoflist = true;
                vm.AddImageToList();
            }
        }
Ejemplo n.º 30
0
        private async void Sc_ViewChanged(object sender, WC.ScrollViewerViewChangedEventArgs e)
        {
            if (e.IsIntermediate || isInnerChange)
            {
                return;
            }

            var borderRange = border.TransformToVisual(this).TransformBounds(new Rect(0, 0, border.ActualWidth, border.ActualHeight));

            //foreach (FrameworkElement c in this.ItemsPanelRoot.Children) {
            for (var i = 0; i < this.ItemsPanelRoot.Children.Count; i++)
            {
                var c = (FrameworkElement)this.ItemsPanelRoot.Children[i];

                var childCenterPoint = c.TransformToVisual(this).TransformPoint(new Point(c.ActualWidth / 2, c.ActualHeight / 2));

                if (borderRange.Contains(childCenterPoint))
                {
                    var childTopPoint = c.TransformToVisual(this).TransformPoint(new Point(0, 0));
                    var offsetY       = (sc.VerticalOffset + childTopPoint.Y - borderRange.Y);

                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => {
                        this.isInnerChange = true;
                        sc.ChangeView(null, offsetY, null);
                    });

                    if (this.SelectedChanged != null)
                    {
                        this.isManual      = true;
                        this.SelectedIndex = i;
                        this.SelectedChanged.Invoke(this, new SelectedChangedEventArgs()
                        {
                            SelectedIndex = i
                        });
                    }

                    break;
                }
            }

            this.isManual      = false;
            this.isInnerChange = false;
        }
Ejemplo n.º 31
0
        void scrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
        {
            //Update the actual view values when the viewport comes to rest after a pan/zoom
            actualNextHOText.Text = scrollViewer.HorizontalOffset.ToString();
            actualNextVOText.Text = scrollViewer.VerticalOffset.ToString();
            actualNextZFText.Text = scrollViewer.ZoomFactor.ToString();

            if (e.IsIntermediate == false)
            {
                actualFinalHOText.Text = scrollViewer.HorizontalOffset.ToString();
                actualFinalVOText.Text = scrollViewer.VerticalOffset.ToString();
                actualFinalZFText.Text = scrollViewer.ZoomFactor.ToString();
            }
            else
            {
                actualFinalHOText.Text = String.Empty;
                actualFinalVOText.Text = String.Empty;
                actualFinalZFText.Text = String.Empty;
            }
        }
Ejemplo n.º 32
0
		private void OnViewChanged(object sender, ScrollViewerViewChangedEventArgs args)
		{

			ScrollViewer _sv = sender as ScrollViewer;
			if (_sv == null)
				return;
			double y = 0;
			double h = headerInner.ActualHeight;
			if (_sv.VerticalOffset >= h)
			{
				y = h;
			}
			else
			{
				y = _sv.VerticalOffset;
			}


			header.Height = h - y;
		}
Ejemplo n.º 33
0
 private void ScrollingHost_ViewChanged(object sender, Windows.UI.Xaml.Controls.ScrollViewerViewChangedEventArgs e)
 {
     if (Window.Current.CoreWindow.Bounds.Width > 1024)//I.e. are we in Full Landscape?  Not Snapped or Filled
     {
         if (e.IsIntermediate)
         {
             //webViewRectangleCanvas.Visibility = Visibility.Visible;
             //WebViewBrush b = new WebViewBrush();
             //b.SourceName = "webView";
             //b.Redraw();
             //webViewRectangleCanvas.Fill = b;
             webView.Visibility = Visibility.Collapsed;
             //double absoluteOffset = ((ScrollViewer)sender).HorizontalOffset;
             //double relativeOffset = absoluteOffset - (int)absoluteOffset;
             //webViewRectangleCanvas.Opacity = 1 - Math.Abs(relativeOffset);
         }
         else
         {
             webView.Visibility = Visibility.Visible;
         }
     }
 }
 private async void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
 {
     if (!e.IsIntermediate)
     {
         if (scrViewr.VerticalOffset >= lstBox.ActualHeight - scrViewr.ActualHeight && !full)
         {
             txtLoading.Visibility = Windows.UI.Xaml.Visibility.Visible;
             await getNearbyPlaces();
             txtLoading.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
         }
     }
     if (scrViewr.VerticalOffset == 0.0)
         gotoTop.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
     else gotoTop.Visibility = Windows.UI.Xaml.Visibility.Visible;
 }