AnsweredAssumed Answered

SketchEditor broken in Quartz (WPF/v100.0)?

Question asked by keith.gemeinhart on Dec 12, 2016
Latest reply on Jan 19, 2018 by mangoyoga

I have code that I wrote in .NET runtime 10.2.7 using the MapView.Editor that allows the user to draw a polyline on the map. I'm sure it came from one of the samples. I'm trying to do the same thing in Quartz (WPF only), and it doesn't seem to work as expected. When I click my button, the map is clearly in editor mode, and I can click to draw the polyline. However, there doesn't seem to be a way to end the editing mode. Typically this is a double-click, but that does nothing. I'm left with the polyline in edit mode.

 

Maybe I'm missing a step, but I couldn't find an example in the docs or in the sample code.

 

Here is my button click code:

private async void Button_Click(object sender, RoutedEventArgs e)
{
    var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Polyline);

    GraphicsOverlay graphicsOverlay;
    if (MyMapView.GraphicsOverlays.Count < 1)
    {
        graphicsOverlay = new GraphicsOverlay();
        MyMapView.GraphicsOverlays.Add(graphicsOverlay);
    }
    else
        graphicsOverlay = MyMapView.GraphicsOverlays[0];

    var outlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Colors.Black, 1.0);
    var line = new Graphic(geometry, outlineSymbol);

    graphicsOverlay.Graphics.Add(line);
}

Outcomes