コード例 #1
0
        private void OnPicturesContainerControlManipulationDelta(Object sender, Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs args)
        {
            if (DetailsControl.Opacity == 1)
            {
                return;
            }

            var positionY = args.Position.Y + args.Cumulative.Translation.Y;

            if ((positionY < 0) || (positionY > Window.Current.Bounds.Height))
            {
                args.Complete();
                return;
            }

            var transform = (CompositeTransform)((FrameworkElement)sender).RenderTransform;

            transform.TranslateY += args.Delta.Translation.Y;
            var opacity = 1 - Math.Abs(transform.TranslateY) / 170;

            if (opacity < 0)
            {
                opacity = 0;
            }
            BackgroundControl.Opacity = opacity;
            CommandBar.Visibility     = Visibility.Collapsed;
        }
コード例 #2
0
 private void Page_ManipulationDelta(object sender, Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs e)
 {
     if (e.IsInertial)
     {
         Point finalPoint = e.Position;
         if (finalPoint.X - initialPoint.X > 50)
         {
             e.Complete();
             this.Frame.Navigate(typeof(DownloadsTab));
         }
         else if (initialPoint.X - finalPoint.X > 100)
         {
             e.Complete();
             this.Frame.Navigate(typeof(BookmarksTab));
         }
     }
 }
コード例 #3
0
 void CatrobatListViewWorker_ManipulationDelta(object sender, Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs e)
 {
     if (e.IsInertial)
     {
         e.Complete();
     }
     if (_dragging == CatrobatListViewDragStaus.Dragging)
     {
         DeltaDrag(e.Position.Y);
     }
     e.Handled = true;
 }