<?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 UI button bound to Editor.Add property never enables in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513454#M13115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;The setup&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a map with two Snapshot operational feature layers - one contains points, the other polygons. One or the other can be edited at a time, though its counterpart displays related features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My MainPage.xaml has a toolbar (StackPanel) with New and Edit buttons. The toolbar StackPanel DataContext is set to an Editor instance defined as a static resource on the page. The Editor in turn has its Map property bound to the page's map object. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The New button's Command is set to to {Binding Add} (The Editor's Add property), and its Edit button's Command is set to {Binding EditVertices} (The Edtor's EditVertices property)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My app sets the Where property on both layers to a particular ID so that only the 'current' feature in each is displayed. After I set the Where properties, I call Update() on each layer to send the request and get the current features. In the UpdateCompleted event handler, I set the Editor.LayerIDs property to the ID of the layer to edit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The problem&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At this point, I expect the New and Edit buttons to be enabled. If my edit layer is the polygon layer, they are. However,&lt;/SPAN&gt;&lt;STRONG&gt; if the edit layer is the point layer, only the Edit button is enabled - the New button is always disabled.&lt;/STRONG&gt;&lt;SPAN&gt; I read the API Reference for the Editor.Add property, it states that Add will be enabled only if LayerIDs references a single layer (it is as described above), and if the FeatureLayer is read-only (it isn't), Add will not be supported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So why is Add disabled, and why is it only disabled for one of my two layers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2012 21:05:11 GMT</pubDate>
    <dc:creator>markcheyne</dc:creator>
    <dc:date>2012-04-12T21:05:11Z</dc:date>
    <item>
      <title>UI button bound to Editor.Add property never enables</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513454#M13115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;The setup&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a map with two Snapshot operational feature layers - one contains points, the other polygons. One or the other can be edited at a time, though its counterpart displays related features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My MainPage.xaml has a toolbar (StackPanel) with New and Edit buttons. The toolbar StackPanel DataContext is set to an Editor instance defined as a static resource on the page. The Editor in turn has its Map property bound to the page's map object. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The New button's Command is set to to {Binding Add} (The Editor's Add property), and its Edit button's Command is set to {Binding EditVertices} (The Edtor's EditVertices property)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My app sets the Where property on both layers to a particular ID so that only the 'current' feature in each is displayed. After I set the Where properties, I call Update() on each layer to send the request and get the current features. In the UpdateCompleted event handler, I set the Editor.LayerIDs property to the ID of the layer to edit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The problem&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At this point, I expect the New and Edit buttons to be enabled. If my edit layer is the polygon layer, they are. However,&lt;/SPAN&gt;&lt;STRONG&gt; if the edit layer is the point layer, only the Edit button is enabled - the New button is always disabled.&lt;/STRONG&gt;&lt;SPAN&gt; I read the API Reference for the Editor.Add property, it states that Add will be enabled only if LayerIDs references a single layer (it is as described above), and if the FeatureLayer is read-only (it isn't), Add will not be supported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So why is Add disabled, and why is it only disabled for one of my two layers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 21:05:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513454#M13115</guid>
      <dc:creator>markcheyne</dc:creator>
      <dc:date>2012-04-12T21:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: UI button bound to Editor.Add property never enables</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513455#M13116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you have more than one layer in your Editor (i.e. LayerIDs is not set and Map has more than 1 editable layer and/or LayerIDs is set but with more than 1 layer), Add button will be disabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will need to separate the Add editors like so. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; &amp;lt;Grid.Resources&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="Layer1AddEditor" Map="{Binding ElementName=MyMap}"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LayerIDs="MyFeatureLayerID1"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/&amp;gt;

&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="Layer2AddEditor" Map="{Binding ElementName=MyMap}"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LayerIDs="MyGraphicsLayerID2"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/&amp;gt;
&amp;nbsp; &amp;lt;/Grid.Resources&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; &amp;lt;Button Content="Add" DataContext="{StaticResource Layer1AddEditor}"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding AddParameter}" CommandParameter="MyFeatureTypeID"/&amp;gt;
&amp;nbsp; &amp;lt;Button Content="Add" DataContext="{StaticResource Layer2AddEditor}"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding AddParameter}" CommandParameter="{StaticResource MySymbol}"/&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:27:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513455#M13116</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T22:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: UI button bound to Editor.Add property never enables</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513456#M13117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks Jennifer for always being there!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;however, this time that wasn't it. It turns out that for my point layer, I *must* provide a CommandParameter for binding my 'New' button to the Editor.Add property. Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;Button x:Name="EditNew" Content="New" Margin="0,0,0,0" Command="{Binding Add}" CommandParameter="U" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When editing my polygon layer, the CommandParameter can remain an empty string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This really caught me by surprise - it's not like my point layer has subtypes. However, and I think this is the crux - it has an attribute SITE_TYPE that we are using for symbolization in the map service's MXD. It is one of those values that I must provide as the CommandParameter in order for the button bound to the Editor.Add property to enable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So that solves my 'the New button won't enable' problem. Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, even though I am specifying a CommandParameter value that somehow the API knows should be a SITE_TYPE value, it doesn't appear to *do* anything with the value - it doesn't automatically set the SITE_TYPE for the new point, for example. Hmmm... No biggie, I'll figure that out...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 19:26:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513456#M13117</guid>
      <dc:creator>markcheyne</dc:creator>
      <dc:date>2012-04-20T19:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: UI button bound to Editor.Add property never enables</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513457#M13118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Editor.Add command will set graphic.Attributes based on type ID so your layer renderer can get a symbol for this graphic. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So is Add button working for you now? Are you getting the correct symbol? Can you check that its attributes are properly set? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically if you look at this service, &lt;/SPAN&gt;&lt;A href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;. Under "Types" section, there is a "Prototype" section where Attributes are pre-defined. These are the values Editor.Add will try to add to your graphic.Attributes. They are also the same attributes, your renderer use (see "Drawing Info").&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 17:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/ui-button-bound-to-editor-add-property-never/m-p/513457#M13118</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2012-04-23T17:44:21Z</dc:date>
    </item>
  </channel>
</rss>

