void HandleMultitouchFingerUp(object sender, FingerInputEventArgs e) { FrameworkElement t = touches[e.Identifier]; Surface.Dispatcher.BeginInvoke(delegate(){ Surface.Children.Remove(t); }); touches.Remove(e.Identifier); }
void HandleMultitouchFingerMove(object sender, FingerInputEventArgs e) { Point p = new Point( (e.Position.Value.X * this.RenderSize.Width), (e.Position.Value.Y * this.RenderSize.Height)); FrameworkElement t = touches[e.Identifier]; Surface.Dispatcher.BeginInvoke(delegate(){ t.SetValue(Canvas.LeftProperty, p.X); t.SetValue(Canvas.TopProperty, p.Y); }); }
void HandleMultitouchFingerDown(object sender, FingerInputEventArgs e) { Ellipse touchaura = new Ellipse(); touches.Add(e.Identifier, touchaura); Surface.Dispatcher.BeginInvoke(()=>{ touchaura.Width = 50D; touchaura.Height = 50D; touchaura.Stroke = new SolidColorBrush(Colors.White); touchaura.StrokeThickness = 4.0; touchaura.Fill = new SolidColorBrush(Colors.Yellow); touchaura.Opacity = 0.45; Surface.Children.Add(touchaura); }); }