Example #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (drawToolClickEventHandler != null)
     {
         DrawToolClickEventArgs args = new DrawToolClickEventArgs();
         Button btn = sender as Button;
         if (btn.Name == "Btn_Point")
             args.drawShapeType = DrawShapeType.Point;
         else if (btn.Name == "Btn_Polyline")
             args.drawShapeType = DrawShapeType.Polyline;
         else if (btn.Name == "Btn_Polygon")
             args.drawShapeType = DrawShapeType.Polygon;
         else if (btn.Name == "Btn_Rectangle")
             args.drawShapeType = DrawShapeType.Rectangle;
         else if (btn.Name == "Btn_Circle")
             args.drawShapeType = DrawShapeType.Circle;
         else if (btn.Name == "Btn_Ellipse")
             args.drawShapeType = DrawShapeType.Ellipse;
         else if (btn.Name == "Btn_Freehand")
             args.drawShapeType = DrawShapeType.Freehand;
         else if (btn.Name == "Btn_Arrow")
             args.drawShapeType = DrawShapeType.Arrow;
         else if (btn.Name == "Btn_Stop")
         {
             args.stopDraw = true;
         }
         drawToolClickEventHandler(this, args);
     }
 }
Example #2
0
 public async void drawToolsClickEventListener(object sender,
                                               UserControls.DrawToolClickEventArgs args)
 {
     if (args.stopDraw)
     {
         if (_mapView.Editor.Cancel.CanExecute(null))
         {
             _mapView.Editor.Cancel.Execute(null);
         }
     }
     else
     {
         await drawGraphics(args.drawShapeType);
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (drawToolClickEventHandler != null)
     {
         DrawToolClickEventArgs args = new DrawToolClickEventArgs();
         Button btn = sender as Button;
         if (btn.Name == "Btn_Point")
         {
             args.drawShapeType = DrawShapeType.Point;
         }
         else if (btn.Name == "Btn_Polyline")
         {
             args.drawShapeType = DrawShapeType.Polyline;
         }
         else if (btn.Name == "Btn_Polygon")
         {
             args.drawShapeType = DrawShapeType.Polygon;
         }
         else if (btn.Name == "Btn_Rectangle")
         {
             args.drawShapeType = DrawShapeType.Rectangle;
         }
         else if (btn.Name == "Btn_Circle")
         {
             args.drawShapeType = DrawShapeType.Circle;
         }
         else if (btn.Name == "Btn_Ellipse")
         {
             args.drawShapeType = DrawShapeType.Ellipse;
         }
         else if (btn.Name == "Btn_Freehand")
         {
             args.drawShapeType = DrawShapeType.Freehand;
         }
         else if (btn.Name == "Btn_Arrow")
         {
             args.drawShapeType = DrawShapeType.Arrow;
         }
         else if (btn.Name == "Btn_Stop")
         {
             args.stopDraw = true;
         }
         drawToolClickEventHandler(this, args);
     }
 }