//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; }
protected override void OnPreviewTouchDown(System.Windows.Input.TouchEventArgs e) { base.OnPreviewTouchDown(e); touchTime = DateTime.Now; touchPoint = e.GetTouchPoint(this.owner).Position.Y; }
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); }
protected override void OnTouchUp(System.Windows.Input.TouchEventArgs e) { base.OnTouchUp(e); var finalPosition = e.GetTouchPoint(this).Position; ProcessTapFinished(finalPosition); }
protected override void OnTouchDown(System.Windows.Input.TouchEventArgs e) { base.OnTouchDown(e); var position = e.GetTouchPoint(this).Position; ProcessTapStart(position); }
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)); } }
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; }
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; } }
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"; } } }
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; }
//Touch support of TextEditor private void MvvmTextEditor_PreviewTouchDown(object sender, System.Windows.Input.TouchEventArgs e) { touchStartPoint = e.GetTouchPoint(mvvmTextEditor).Position; mvvmTextEditor.IsTouched = true; }
protected override void OnTouchUp(System.Windows.Input.TouchEventArgs e) { Callback(e.GetTouchPoint(this).Position); base.OnTouchUp(e); }
private void GameCanvas_TouchDown(object sender, System.Windows.Input.TouchEventArgs e) { start = e.GetTouchPoint(sender as IInputElement).Position; }