private void drawingCanvas_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { Point mouseLocation = e.GetPosition(this.drawingCanvas); Circle myCircle = new Circle(100); if (myCircle is IDraw) { IDraw drawCircle = myCircle; drawCircle.SetLocation((int)mouseLocation.X, (int)mouseLocation.Y); drawCircle.Draw(this.drawingCanvas); } if (myCircle is IColor) { IColor colorCircle = myCircle; colorCircle.SetColor(Colors.HotPink); } }
private void drawingCanvas_RightTapped(object sender, RightTappedRoutedEventArgs e) { Point mouseLocation = e.GetPosition(this.drawingCanvas); Circle myCircle = new Circle(100); if (myCircle is IDraw) { IDraw drawCircle = myCircle; drawCircle.X = (int)mouseLocation.X; drawCircle.Y = (int)mouseLocation.Y; drawCircle.Draw(drawingCanvas); } if (myCircle is IColor) { IColor colorCircle = myCircle; colorCircle.Color = Colors.HotPink; } }