namespace EllipseDrawing
{
/// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { Color[] colours = new Color[10] {Colors.White, Colors.Yellow, Colors.Green,Colors.LightBlue, Colors.LightGreen, Colors.Blue, Colors.LightGray, Colors.LightPink, …show more content…
public MainWindow() { InitializeComponent(); } private void canvas_TouchDown(object sender, TouchEventArgs e) { counter = (counter + 1) % 10; elips = new Ellipse(); elips.StrokeThickness = 100; elips.Stroke = new SolidColorBrush(colours[counter]);//Changing colour of ellipse with use of counter
TouchPoint touchPoint = e.GetTouchPoint(canvas); Canvas.SetLeft(elips, touchPoint.Position.X); Canvas.SetRight(elips, touchPoint.Position.X); Canvas.SetTop(elips, touchPoint.Position.Y); Canvas.SetBottom(elips, touchPoint.Position.Y);
movingelip[e.TouchDevice.Id] = elips; canvas.Children.Add(elips); } private void canvas_TouchMove(object sender, TouchEventArgs