<?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: Can we clone a featurelayer in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/can-we-clone-a-featurelayer/m-p/605798#M15526</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can subscribe to Layer.Graphics.CollectionChanged once layer has been initialized so you may add/remove graphics of the same geometry, symbol and attributes to the other GraphicsLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Graphics cannot be shared by layers, but you can clone geometry using Geometry.Clone(Geometry toClone). Here's a short code snippet, where target is another GraphicsLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
void Graphics_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if (e.NewItems != null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var item in e.NewItems)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic g = item as Graphic;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic clone = new Graphic()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry = Geometry.Clone(g.Geometry),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Symbol = g.Symbol
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var attribute in g.Attributes)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clone.Attributes[attribute.Key] = attribute.Value;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; target.Graphics.Add(clone);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:58:15 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2021-12-12T01:58:15Z</dc:date>
    <item>
      <title>Can we clone a featurelayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/can-we-clone-a-featurelayer/m-p/605797#M15525</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;I have a featurelayer(f) which contains features which we deal with. This is defined on the XAML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have created a draw tool for adding new polygons&amp;nbsp; to this featurelayer(f) using templatePicker.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a requirement where, we want to add these newly drawn polygons first to a temporary featurelayer same as the featurelayer f.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so wanted to know whether we can clone the featurelayer f in the code and create a temporary featurelayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Muralidhar Moka&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 15:52:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/can-we-clone-a-featurelayer/m-p/605797#M15525</guid>
      <dc:creator>MuralidharMoka</dc:creator>
      <dc:date>2011-06-07T15:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can we clone a featurelayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/can-we-clone-a-featurelayer/m-p/605798#M15526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can subscribe to Layer.Graphics.CollectionChanged once layer has been initialized so you may add/remove graphics of the same geometry, symbol and attributes to the other GraphicsLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Graphics cannot be shared by layers, but you can clone geometry using Geometry.Clone(Geometry toClone). Here's a short code snippet, where target is another GraphicsLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
void Graphics_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if (e.NewItems != null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var item in e.NewItems)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic g = item as Graphic;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic clone = new Graphic()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry = Geometry.Clone(g.Geometry),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Symbol = g.Symbol
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var attribute in g.Attributes)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clone.Attributes[attribute.Key] = attribute.Value;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; target.Graphics.Add(clone);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/can-we-clone-a-featurelayer/m-p/605798#M15526</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-12T01:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can we clone a featurelayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/can-we-clone-a-featurelayer/m-p/605799#M15527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FeatureLayer needs a service to work against, so the only thing you can really clone is Url, but that means your features etc are also pulled from the service there, and that's probably not what you want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead create an empty GraphicsLayer and use that to edit instead (you could copy the Renderer over to get some similar rendering). However, then TemplatePicker might now work that well, and you might have to go a little bit more low-level and the Draw class instead. The TemplatePicker is really designed to work with a FeatureLayer(s) backed by a FeatureService.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 22:42:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/can-we-clone-a-featurelayer/m-p/605799#M15527</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2011-06-07T22:42:55Z</dc:date>
    </item>
  </channel>
</rss>

