AnsweredAssumed Answered

How test my draw before drawing?

Question asked by laurevois on Feb 26, 2020
Latest reply on Mar 10, 2020 by mnielsen-esristaff

Hi everyone,

 

I've a problem with drawing on map on ArcGIS SDK 100.7 for .NET.

I'm using SketchEditor and I need to configure visibility of a button with SketchEditor.CompleteCommand.CanExecute.

 

My problem is that the execution of my test is always done before the drawing.

 

Sequence step by step :

- //Step 1

- Geometry g = await MapView.SketchEditor.StartAsync(SketchCreationMode.Point, true); //Async method

- MapView.SketchEditor.CompleteCommand.CanExecute(null); //Return false

- //Step 2 : Click on the map

MapView.SketchEditor.CompleteCommand.CanExecute(null); //Return false

- //The 1st drawing appears on the map

- //Step 3 : Click on the map

- MapView.SketchEditor.CompleteCommand.CanExecute(null); //Return true but detect only 1st point instead of 1st & 2nd.

- //The 2nd drawing appears on the map

 

 

My goal is to detect the first point into my first control.

The difficult is my initialisation are asynchrone, but my control is synchrone.


I tried to pass the 2 asynchronously but the error is still present.

 

Currently, my button appears when creating the 2nd point. I have the same problem for polylines and polygons. My button appears at the 3rd point for my polyline, and at my 4th point for my polygon. There is always a point of delay.

 

Have you got any idea?

 

Thank you

Outcomes