When I am in Creation Mode or Edit Mode in SketchEditor.StartAsync, I have to click the geometry to select it first, and then move it. Is it possilble to be able to move the geometry when in Creation/Edit mode without having to do that extra click? Tried to put isSelected as true but doesn't really work for moving the geometry.
SketchEditor.EditConfiguration has AllowMove property but it is just bool.
Thanks!
Hi!
I have a similar problem. I want to move vertices of a geometry without extra selection.
I found the property RequireSelectionBeforeDrag in the SketchEditor.EditConfiguration , but it makes no difference if set to true or false. I always have to preselect the vertices I want to move. In Runtime 10.2.7 it worked!
On the other hand I want to disable moving the whole geometry and set the property AllowMove to false. However, I still can move my geometry!
I am using Runtime Quartz 100.3
Thanks
RequireSelectionBeforeDrag=False should allow you to drag the geometry or vertices provided move gesture hit the geometry outline or vertex.
Perhaps the difference is that in v10.x, geometry can be moved even if you hit the fill/center of polygon feature. We already have an open design issue to reconsider this behavior.
RequireSelectionBeforeDrag=False or AllowMove = false don't effect anything, if set in the EditConfiguration of the SketchEditor.
No matter if I hit the fill/Center or the outline.
However, after A LOT OF tests, if found a workaround: If you use the overload of the SketchEditor.StartAsync(...) , and pass an EditConfiguration extra, it works. You even can take just the previously modified Editor - EditConfiguration.
// my "pseudocode" test method
private static async void TestEditor(
MapView mapView , Geometry editGeometry)
{
mapView.SketchEditor.EditConfiguration.AllowMove = false;
Hi Karin,
Thank you for this clarification. It's actually by design that EditConfiguration properties are determined at run-time based on SketchCreationMode parameter. For example, SketchCreationMode.Polygon will enable AllowVertexEditing whereas SketchCreationMode.Point or SketchCreationMode.FreehandPolygon will disable this.
You can still overwrite these properties in XAML through binding, or
<CheckBox IsChecked="{Binding ElementName=MyMapView, Path=SketchEditor.EditConfiguration.RequireSelectionBeforeDrag, Mode=TwoWay}"
Content="RequireSelectionBeforeDrag"/>
in code, after StartAsync
var drawTask = MyMapView.SketchEditor.StartAsync(SketchCreationMode.Polygon);
MyMapView.SketchEditor.EditConfiguration.RequireSelectionBeforeDrag = false;
var geometry = await drawTask;
However if EditConfiguration is also passed as parameter to StartAsync, we honor the properties set as much as the geometry type or creation mode would allow.
You brought up a fair point though that there are EditConfiguration properties like RequireSelectionByDrag that don't necessarily depend on the geometry type or creation mode which we probably should not overwrite. I have logged an issue to address this.
Thank you both for your feedback.