MapView.Editor.RequestShapeAsync crashes with Stylus

4164
1
12-24-2015 02:03 PM
NagendraPutti
New Contributor

Hi, Ref : ArcGIS Runtime 10.2.04 for .NET We are facing a crash while using stylus to perform drawing with the help of MapView.Editor.RequestShapeAsync method. The following is the method. The UI for the application is built on WPF and ArcGIS Runtime 10.2.04 for .NET. As a workaround, we are using a delay of 200ms,  but that workaround brings down crash issue but always while drawing a second polygon, the first click (or pen tap) is always ignored. This happens only with Stylus. Any suggestions.. to track down the error, I have extended the Editor class and added log statements within OnGenerateSymbol, I can share it with you if that helps.

private async void Button1_Click(object sender, RoutedEventArgs e)         {           

     if (MapView1.Editor == null) return;           

     if (MapView1.Editor.IsActive) MapView1.Editor.Cancel.Execute(null);           

     try             {                              InPolygonDrawMode = true; InPolylineDrawMode = false;               

     while (InPolygonDrawMode)                 {                   

          MapView1.Editor = te;                   

          LogInfo("begin geom at " + DateTime.Now.ToString("hh.mm.ss.ffffff"));                   

          Geometry myGeometry = await MapView1.Editor.RequestShapeAsync(DrawShape.Polygon);                   

          LogInfo("end geom at " + DateTime.Now.ToString("hh.mm.ss.ffffff"));                                     

          SimpleFillSymbol myPolygonSymbol = (SimpleFillSymbol)LayoutRoot.Resources["MyPolygonSymbol"];                   

          Graphic myGraphic = new Graphic(myGeometry, myPolygonSymbol);                   

          ThisGraphicsLayer.Graphics.Add(myGraphic);                   

          MapView1.Editor = null;                   

          LogInfo("Before delay " + DateTime.Now.ToString("hh.mm.ss.ffffff"));                   

          await Task.Delay(200);                   

          LogInfo("After delay " + DateTime.Now.ToString("hh.mm.ss.ffffff"));                 }             }           

     catch(TaskCanceledException t){ LogInfo("TaskCanceled at " + DateTime.Now.ToString("hh.mm.ss.ffffff")); }           

     catch(Exception ex) {    InPolygonDrawMode = false; }         }                 

0 Kudos
1 Reply