<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Cancel Editing? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411335#M10674</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The only operation you can really do with point geometry is to move them. This is why Editor.EditVertices does not make sense to activate on a graphic with point geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you can do is only activate EditVertices for polyline and polygon geometries. And handle the move on point geometries by providing offset to its X,Y values using MouseMove and MouseLeftButtonUp events or you can listen to the next MouseClick that sets the new location of the point geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 May 2011 16:16:02 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2011-05-05T16:16:02Z</dc:date>
    <item>
      <title>How to Cancel Editing?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411330#M10669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible add logic to decide whether or not (based on some conditions) if it is allowed to start editing a particular graphic and cancel edition if needed? I would like to do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
public MyClass()
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; MyEditor.EditStarting += OnEditStarting;
&amp;nbsp;&amp;nbsp;&amp;nbsp; MyEditor.EditCompleted += OnEditCompleted;
}

private void OnEditStarting(object sender, Editor.EditEventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!IsEditAllowed(e.Graphic))
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Cancel = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}

private void OnEditCompleted(object sender, Editor.EditEventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
}

private bool IsEditAllowed(Graphic graphic)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 19:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411330#M10669</guid>
      <dc:creator>FrancoisChartrand</dc:creator>
      <dc:date>2010-10-06T19:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to Cancel Editing?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411331#M10670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is a CancelActive command in the Editor that will let you do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 if (MyEditor.CancelActive.CanExecute(null))
&amp;nbsp; MyEditor.CancelActive.Execute(null);
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure if this is sufficient for your use case, but this lets you cancel the active command (i.e. EditVertices, Select, etc.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need to perform check on the graphic before EditVertices command is activated, you can activate EditVertices in code-behind instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
 {
&amp;nbsp; bool canEdit = IsEditAllowed(e.Graphic);
&amp;nbsp; if (canEdit &amp;amp;&amp;amp; MyEditor.EditVertices.CanExecute(e.Graphic))
&amp;nbsp;&amp;nbsp; MyEditor.EditVertices.Execute(e.Graphic);
 }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:40:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411331#M10670</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T18:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Cancel Editing?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411332#M10671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;If you need to perform check on the graphic before EditVertices command is activated, you can activate EditVertices in code-behind instead.&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
 {
&amp;nbsp; bool canEdit = IsEditAllowed(e.Graphic);
&amp;nbsp; if (canEdit &amp;amp;&amp;amp; MyEditor.EditVertices.CanExecute(e.Graphic))
&amp;nbsp;&amp;nbsp; MyEditor.EditVertices.Execute(e.Graphic);
 }
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This solution works fine except for MapPoints. I'm using a GraphicsLayer. When passing a graphic that uses a MapPoint geometry to the EditVertices command, it doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when passing null and then the user clicks on the graphic, it is possible to move it. This means that the only way to move a MapPoint is to use the EditVertices.Execute(null) with null parameter. Then the user will be able to move the MapPoint using mouse drag and drop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug? If this is the expected behaviour, how should I perform check on the graphic before EditVertices command is activated?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:40:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411332#M10671</guid>
      <dc:creator>FrancoisChartrand</dc:creator>
      <dc:date>2021-12-11T18:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to Cancel Editing?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411333#M10672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is by design and noted in our documentation: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Editor~EditVertices.html"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Editor~EditVertices.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While polyline, polygon, point share the same Editor.Command EditVertices, editing geometry on a polyline or polygon is a different operation from moving a point. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With CommandParameter not set or null, EditVertices will act on all graphics found in Editor.Layers (All geometry types are supported in this case). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If CommandParameter is a graphic, then EditVertices will act only on the specified graphic (Points are not supported in this case).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 May 2011 16:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411333#M10672</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-05-04T16:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to Cancel Editing?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411334#M10673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If CommandParameter is a graphic, then EditVertices will act only on the specified graphic (Points are not supported in this case).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ok but then I'm back to my initial concern: how could I perform check on the graphics (using MapPoints) before EditVertices command is activated?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 May 2011 16:56:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411334#M10673</guid>
      <dc:creator>FrancoisChartrand</dc:creator>
      <dc:date>2011-05-04T16:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to Cancel Editing?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411335#M10674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The only operation you can really do with point geometry is to move them. This is why Editor.EditVertices does not make sense to activate on a graphic with point geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you can do is only activate EditVertices for polyline and polygon geometries. And handle the move on point geometries by providing offset to its X,Y values using MouseMove and MouseLeftButtonUp events or you can listen to the next MouseClick that sets the new location of the point geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 16:16:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411335#M10674</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-05-05T16:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to Cancel Editing?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411336#M10675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The only operation you can really do with point geometry is to move them. This is why Editor.EditVertices does not make sense to activate on a graphic with point geometry.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree. It doesn't make sense to use EditVertices for points. But then, what is the proper way for moving points? Are you planning to add an Editor.Move command for points?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What you can do is only activate EditVertices for polyline and polygon geometries. And handle the move on point geometries by providing offset to its X,Y values using MouseMove and MouseLeftButtonUp events or you can listen to the next MouseClick that sets the new location of the point geometry.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll do that as a workaround &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2011 17:27:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-cancel-editing/m-p/411336#M10675</guid>
      <dc:creator>FrancoisChartrand</dc:creator>
      <dc:date>2011-05-13T17:27:01Z</dc:date>
    </item>
  </channel>
</rss>

