Exemplo n.º 1
0
        private void MainContent_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
        {
            var  owner    = sender as FrameworkElement;
            bool isInArea = false;

            switch (this.DrawerLocation)
            {
            case DrawerLocation.Left:
                isInArea = e.Position.X < this.TouchTargetThreshold;
                break;

            case DrawerLocation.Right:
                isInArea = e.Position.X > owner.ActualWidth - this.TouchTargetThreshold;
                break;

            case DrawerLocation.Top:
                isInArea = e.Position.Y < this.TouchTargetThreshold;
                break;

            case DrawerLocation.Bottom:
                isInArea = e.Position.Y > owner.ActualHeight - this.TouchTargetThreshold;
                break;
            }

            if (isInArea)
            {
                this.DrawerState = Primitives.DrawerState.Moving;
                this.Context.MainContentStoryBoard.Begin();
                this.Context.MainContentStoryBoard.Pause();
                this.Context.DrawerStoryBoard.Begin();
                this.Context.DrawerStoryBoard.Pause();

                this.shouldAnimate = true;
            }
        }
Exemplo n.º 2
0
 private static void FrameworkElement_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     if (PointerDeviceType.Touch.Equals(e.PointerDeviceType))
     {
         System.Diagnostics.Debug.WriteLine($"FrameworkElement_ManipulationStarted{e.Position.X},{e.Position.Y}");
     }
 }
Exemplo n.º 3
0
        private void OnColorPointVisualDragStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
        {
            if (sender is ColorPointVisual visual)
            {
                visual.IsSelected = true;
            }

            FrameworkElement element = e.OriginalSource as FrameworkElement;

            if (element == null)
            {
                return;
            }

            var bounds = element.GetBoundsRelativeTo(this);

            if (bounds == null)
            {
                return;
            }

            var position = new Point(bounds.Value.X + bounds.Value.Width / 2, bounds.Value.Y + bounds.Value.Height / 2);

            OnColorPointVisualDragStarted(sender as ColorPointVisual, position);
        }
Exemplo n.º 4
0
        private void AssociatedObject_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
        {
            NowSwiping   = true;
            _IsSkipSwipe = false;

            // 画面端の遊びチェック
            bool isOutOfEdgeBounce = false;
            var  play = SwipeEdgeOfPlay;

            if (e.Container is FrameworkElement)
            {
                var fe     = e.Container as FrameworkElement;
                var width  = fe.ActualWidth;
                var height = fe.ActualHeight;

                Rect swipeRect = new Rect(play.Left, play.Top, width - play.Right - play.Left, height - play.Bottom - play.Top);
                if (!swipeRect.Contains(e.Position))
                {
                    isOutOfEdgeBounce = true;

                    System.Diagnostics.Debug.WriteLine("Swipe out of bounce");
                }
            }

            if (!isOutOfEdgeBounce)
            {
                InitializeSwipe(e.Cumulative);
                e.Handled = true;
            }
            else
            {
                _IsSkipSwipe = true;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// save pointer state from ManipulationStartedRoutedEventArgs
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public static PointerState _(Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e, object sender, string remarks)
        {
            var ret = new PointerState
            {
                Sender         = sender,
                Remarks        = remarks,
                PositionOrigin = ScreenPos.From(e.Position.X, e.Position.Y),
                Position       = ScreenPos.From(e.Position.X, e.Position.Y),
                IsInContact    = true,
                Scale          = e.Cumulative.Scale,
                Rotation       = Angle.FromDeg(e.Cumulative.Rotation),
                Time           = DateTime.Now,
            };

            switch (e.PointerDeviceType)
            {
            case PointerDeviceType.Pen:
                ret.DeviceType = PointerState.DeviceTypes.Pen;
                break;

            case PointerDeviceType.Touch:
                ret.DeviceType = PointerState.DeviceTypes.Touch;
                break;

            case PointerDeviceType.Mouse:
                ret.DeviceType = PointerState.DeviceTypes.Mouse;
                break;
            }
            return(ret);
        }
Exemplo n.º 6
0
 private void LayoutController_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     if (!_manipulationsEnabled)
     {
         return;
     }
     SplitviewLayer.Width = LayoutController.Width;
 }
Exemplo n.º 7
0
 private void Rating_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     if (!ReadOnly)
     {
         PerformValueCalculation(e.Position, e.Container);
         UpdateDragHelper();
     }
 }
Exemplo n.º 8
0
 private void Drawer_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     this.DrawerState   = Primitives.DrawerState.Moving;
     this.shouldAnimate = true;
     this.Context.MainContentStoryBoardReverse.Begin();
     this.Context.MainContentStoryBoardReverse.Pause();
     this.Context.DrawerStoryBoardReverse.Begin();
     this.Context.DrawerStoryBoardReverse.Pause();
 }
Exemplo n.º 9
0
        public UwpLongPressEventArgs(FrameworkElement element, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs args, long elapsedMilliseconds)
        {
            ElementPosition = element.GetXfViewFrame();
            var point = args.Position;

            ElementTouches = new Xamarin.Forms.Point[] { point.ToXfPoint() };
            WindowTouches  = new Xamarin.Forms.Point[] { element.PointInNativeAppWindowCoord(point).ToXfPoint() };
            Duration       = elapsedMilliseconds;
        }
Exemplo n.º 10
0
        private void TimelinePanel_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
        {
            if (IsLocked)
            {
                return;
            }

            _manipulating  = true;
            _originalIndex = ItemIndex;
        }
Exemplo n.º 11
0
 private void GestureRect_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     VisualStateManager.GoToState(this, "Swiping", true);
     if (ContentGridTrans != null)
     {
         ContentGridTrans.X = 0;
     }
     if (ShadowVisual != null)
     {
         ShadowVisual.IsVisible = true;
     }
 }
Exemplo n.º 12
0
        void behavior_ElementManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
        {
            //get max z-index
            int maxzindex           = Items.Select(x => Canvas.GetZIndex(this.ContainerFromItem(x) as UIElement)).Max();
            DependencyObject parent = VisualTreeHelper.GetParent(sender as UIElement);

            if (parent is Grid)
            {
                (sender as UIElement).SetValue(Canvas.ZIndexProperty, ++maxzindex);
            }
            else //ContentPresenter
            {
                parent.SetValue(Canvas.ZIndexProperty, ++maxzindex);
            }
        }
Exemplo n.º 13
0
        private void LaunchPokeballButton_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
        {
            Logger.Write("Manipulation Started...");

            // Show the ball a little bigger when held
            PokeballTransform.ScaleX *= 1.05f;
            PokeballTransform.ScaleY *= 1.05f;

            // Store this so that we can revert back to this poition
            InitItemX = (float)PokeballTransform.TranslateX;
            InitItemY = (float)PokeballTransform.TranslateY;

            PastPositions.Clear();
            PastPositions.Enqueue(new Tuple <Vector3, DateTime>(
                                      new Vector3(InitItemX, InitItemY, 0),
                                      DateTime.Now
                                      ));
        }
Exemplo n.º 14
0
 void ImageSwitch_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     this.ManipulationDelta += ImageSwitch_ManipulationDelta;
 }
 private void Sv_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     currentX = e.Position.X;
     currentY = e.Position.Y;
 }
Exemplo n.º 16
0
 private void SwapChainBackgroundPanel_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     // TODO: Add event handler implementation here.
     int a = 0;
 }
Exemplo n.º 17
0
 private void Page_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     initialPoint = e.Position;
 }
Exemplo n.º 18
0
 private void Grid_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     Debug.WriteLine("Manipulation Started : " + e.Position.X.ToString());
     initialpoint = e.Position;
 }
Exemplo n.º 19
0
 private void OnListViewItemManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     _initialpoint = e.Position;
 }
 private void RelativePanel_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
 }
Exemplo n.º 21
0
 protected override void OnManipulationStarted(Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     //base.OnManipulationStarted(e);
 }
Exemplo n.º 22
0
        private void BoxExRenderer_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
        {
            var el = this.Element as BoxViewEx;

            el.OnManipulationStarted(el, new PazzleDrag.ManipulationStartedRoutedEventArgs());
        }
Exemplo n.º 23
0
 public UwpLongPressEventArgs(Windows.UI.Xaml.FrameworkElement element, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs args, long elapsedMilliseconds)
 {
     ViewPosition = element.GetXfViewFrame();
     Touches      = new Xamarin.Forms.Point[] { args.Position.ToXfPoint() };
     Duration     = elapsedMilliseconds;
 }
Exemplo n.º 24
0
 private void SlidePanel_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     _prePoint = e.Position;
 }
Exemplo n.º 25
0
 private static void obj_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     Rotate((UIElement)sender, 30, 0, false);
 }
 private void LayoutRoot_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
 }
Exemplo n.º 27
0
 /// <summary>
 /// Called before the ManipulationStarted event occurs.
 /// </summary>
 /// <param name="e">Event data for the event.</param>
 protected override void OnManipulationStarted(Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     base.OnManipulationStarted(e);
     Debug.WriteLine("Manipulation started.");
 }
Exemplo n.º 28
0
 void Control_ManipulationStarted(object sender, Windows.UI.Xaml.Input.ManipulationStartedRoutedEventArgs e)
 {
     //  e.ManipulationOrigin
 }