コード例 #1
0
        //Touch support for Browser
        private void MvvmCWBrowser_PreviewTouchDown(object sender, System.Windows.Input.TouchEventArgs e)
        {
            string src = $"onmousedown=new Function(\"return false\")";

            mvvmCWBrowser.GetMainFrame().ExecuteJavaScriptAsync(src);
            touchStartPoint = e.GetTouchPoint(mvvmCWBrowser).Position;
        }
コード例 #2
0
ファイル: LoopPanelVertical.cs プロジェクト: 494760542/Square
        protected override void OnPreviewTouchDown(System.Windows.Input.TouchEventArgs e)
        {
            base.OnPreviewTouchDown(e);

            touchTime = DateTime.Now;
            touchPoint = e.GetTouchPoint(this.owner).Position.Y;
        }
コード例 #3
0
        public void Collect(System.Windows.Input.TouchEventArgs e)
        {
            Point       pt  = e.GetTouchPoint(_source).Position;
            PathSegment seg = new LineSegment(new Point(pt.X, pt.Y), false);

            _psCollection.Add(seg);
        }
コード例 #4
0
        protected override void OnTouchUp(System.Windows.Input.TouchEventArgs e)
        {
            base.OnTouchUp(e);
            var finalPosition = e.GetTouchPoint(this).Position;

            ProcessTapFinished(finalPosition);
        }
コード例 #5
0
        protected override void OnTouchDown(System.Windows.Input.TouchEventArgs e)
        {
            base.OnTouchDown(e);
            var position = e.GetTouchPoint(this).Position;

            ProcessTapStart(position);
        }
コード例 #6
0
        public void SetCropTarget(System.Windows.Input.TouchEventArgs e)
        {
            this._selectedImage = null;

            Visual visual = this._inkCanvas as Visual;

            if (visual != null)
            {
                //선택한 위치가 이미지랑 겹치는지 확인
                //겹치면 가장 위 이미지에 대해서 정보를 클래스에 저장
                VisualTreeHelper.HitTest(this._inkCanvas.Parent as Visual,
                                         new HitTestFilterCallback(p =>
                {
                    if (p is TouchableImage)
                    {
                        this._selectedImage = p as TouchableImage;
                        return(HitTestFilterBehavior.Stop);
                    }

                    this._selectedImage = null;
                    return(HitTestFilterBehavior.Continue);
                }),
                                         new HitTestResultCallback(q =>
                {
                    return(HitTestResultBehavior.Continue);
                }),
                                         new PointHitTestParameters(e.GetTouchPoint(null).Position));
            }
        }
コード例 #7
0
        private void MvvmCWBrowser_PreviewTouchMove(object sender, System.Windows.Input.TouchEventArgs e)
        {
            touchEndPoint = e.GetTouchPoint(mvvmCWBrowser).Position;
            string src = $"scrollBy({-touchEndPoint.X+touchStartPoint.X}, {-touchEndPoint.Y + touchStartPoint.Y})";

            mvvmCWBrowser.GetMainFrame().ExecuteJavaScriptAsync(src);
            touchStartPoint = touchEndPoint;
        }
コード例 #8
0
ファイル: LoopPanelVertical.cs プロジェクト: 494760542/Square
 protected override void OnPreviewTouchMove(System.Windows.Input.TouchEventArgs e)
 {
     base.OnPreviewTouchMove(e);
     TimeSpan ts = DateTime.Now - touchTime;
     double  currentPoint= e.GetTouchPoint(this.owner).Position.Y;
     if (ts.TotalMilliseconds > 100 & (Math.Abs(touchPoint - currentPoint) < 60))
     {
         CanVerticallyScroll = false;
         touchTime = DateTime.Now;
         touchPoint = currentPoint;
         return;
     }
     if (!CanVerticallyScroll)
     {
         CanVerticallyScroll = true;
     }
 }
コード例 #9
0
        private void GameCanvas_TouchUp(object sender, System.Windows.Input.TouchEventArgs e)
        {
            Point current = e.GetTouchPoint(sender as IInputElement).Position;

            if (squareDistance(current.X, start.X, current.Y, start.Y))
            {
                if (Math.Abs(current.X - start.X) < 50 && current.Y > start.Y)
                {
                    direction = "down";
                }
                else if (Math.Abs(current.X - start.X) < 50 && current.Y < start.Y)
                {
                    direction = "up";
                }
                else if (Math.Abs(current.Y - start.Y) < 50 && current.X < start.X)
                {
                    direction = "left";
                }
                else if (Math.Abs(current.Y - start.Y) < 50 && current.X > start.X)
                {
                    direction = "right";
                }
            }
        }
コード例 #10
0
 private void MvvmTextEditor_PreviewTouchMove(object sender, System.Windows.Input.TouchEventArgs e)
 {
     touchEndPoint = e.GetTouchPoint(mvvmTextEditor).Position;
     mvvmTextEditor.ScrollToVerticalOffset(mvvmTextEditor.VerticalOffset + (touchStartPoint.Y - touchEndPoint.Y));
     touchStartPoint = touchEndPoint;
 }
コード例 #11
0
 //Touch support of TextEditor
 private void MvvmTextEditor_PreviewTouchDown(object sender, System.Windows.Input.TouchEventArgs e)
 {
     touchStartPoint          = e.GetTouchPoint(mvvmTextEditor).Position;
     mvvmTextEditor.IsTouched = true;
 }
コード例 #12
0
 protected override void OnTouchUp(System.Windows.Input.TouchEventArgs e)
 {
     Callback(e.GetTouchPoint(this).Position);
     base.OnTouchUp(e);
 }
コード例 #13
0
 private void GameCanvas_TouchDown(object sender, System.Windows.Input.TouchEventArgs e)
 {
     start = e.GetTouchPoint(sender as IInputElement).Position;
 }