I would like to occur a MouseDownEvent by program.
My program's purpose is create a Feature by MyMapView.SketchEditor.
*Current Program flow:
1. 1st Click > MyMapView.MouseDown Event "createFeature" method add.
MyMapView.MouseDown += createFeature;
2. 2nd Click > createFeature occured.
*I would like to this flow.
1. 1st Click > MyMapView.MouseDown Event "createFeature" method add + createFeature method occured.
So I think need to MouseDownEvnet by program.
What would you suggest I do?
If you use the sketch editor, you don't need to use events. This should be sufficient:
var point = await mapView.SketchEditor.StartAsync(SketchCreationMode.Point);
Thank you for your comment. I'm sorry. I should have explained it more clearly.
I already wrote a program to create a feature. But something that requires much trouble to write a polyline.
Current program is requires much trouble.
Sample:
※1st Click -> Event add, 2nd Click -> Initial point drawing, 3rd Click->end point drawing
private async void MyMapView_GeoViewTapped(object sender, sri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e)
{
MyMapView.MouseDown += createFeature;
await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Polyline);
}
private void createFeature(){
://click point -> snap to near feature point
:
await table.AddFeatureAsync(newFeature);
MyMapView.MouseDown -= createFeature;
}
I think reduce trouble.So I need to add MouseDownEvnet by program.
What would you suggest I do?
Try adding "false" to the start async call. That should auto-complete instantly.
sketchEditor.StartAsync(Esri.ArcGISRuntime.UI.SketchCreationMode.Point, false);
Otherwise can't you just use the GeoViewTapped event?
Thank you for your comment.
I try use the GeoViewTapped event.