<?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: Programatically Adding a Feature Layer in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703941#M18079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got my issue solved.&amp;nbsp; The issue was that I had a notify property changed on the layer collection and when it ran it was thinking that the feature layer was a graphics layer and then drawing the feature layer and the graphics layer on top of my feature layer blocking it from the mouseup event.&amp;nbsp; By checking if it was a feature layer first i was able to kick out of that function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Sep 2011 22:38:39 GMT</pubDate>
    <dc:creator>BrianGustafson</dc:creator>
    <dc:date>2011-09-14T22:38:39Z</dc:date>
    <item>
      <title>Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703940#M18078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a feature layer that I am trying to add in code and then add a click event to that layer.&amp;nbsp; It has worked in the past but for some reason it is no longer working, no events are fired when I click on the layer.&amp;nbsp; I have another feature layer that I added in XAML that uses the same event and that layer works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; _fLayer = new FeatureLayer();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.ID = AvailParcels.SelectedItem.ToString();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int iID = GetParcelLayerId(_fLayer.ID);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.Url = "xxxx" + iID;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IRenderer _renderer = LayoutRoot.Resources["MyRenderer"] as IRenderer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.Renderer = _renderer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutFields _outFields = new OutFields();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _outFields.Add("*");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.MinimumResolution = .000001;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.MaximumResolution = 45;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //getDisplayField(_fLayer.Url);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.OutFields = _outFields;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.Mode = FeatureLayer.QueryMode.OnDemand;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _fLayer.MouseLeftButtonUp += new GraphicsLayer.MouseButtonEventHandler(FeatureLayer_MouseLeftButtonUp);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 18:55:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703940#M18078</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2011-09-14T18:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703941#M18079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got my issue solved.&amp;nbsp; The issue was that I had a notify property changed on the layer collection and when it ran it was thinking that the feature layer was a graphics layer and then drawing the feature layer and the graphics layer on top of my feature layer blocking it from the mouseup event.&amp;nbsp; By checking if it was a feature layer first i was able to kick out of that function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 22:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703941#M18079</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2011-09-14T22:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703942#M18080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For some odd reason I am unable to load my Feature Layer at run-time.&amp;nbsp; This is some of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FeatureLayer fs = new FeatureLayer();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;fs.Url = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://50...../FeatureServer/0" rel="nofollow" target="_blank"&gt;http://50...../FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;";&amp;nbsp; // here, I intentionally removed the inner url data&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.Renderer = LayoutRoot.Resources["AlertTypesRenderer"] as IRenderer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.OutFields.Add("*");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.ID = "SmallLeaks";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.Initialize();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MyMap.Layers.Add(fs);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nothing is added to the map.&amp;nbsp; But it works fine in XAML code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;lt;esri:FeatureLayer ID="MyMeters" Renderer="{StaticResource AlertTypesRenderer}" Url="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://50..../FeatureServer/0" rel="nofollow" target="_blank"&gt;http://50..../FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;" OutFields="*"&amp;nbsp; /&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would you, or anyone else, know as to why the code-behind (C#) returns nothing, while the XAML code returns nothing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need the run-time option, because I have check boxes that control which values to use to display my points; I would like to use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.Where = "AlertType = 14";&amp;nbsp; // for one check box&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.Where = "AlertType = 11";&amp;nbsp; // for another check box&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; and son on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, I cannot even see any of the points!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 17:45:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703942#M18080</guid>
      <dc:creator>HugoCardenas</dc:creator>
      <dc:date>2011-09-20T17:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703943#M18081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried looping through your layer collection just for debugging purposes to make sure that the layer is either missing from the collection or does it exist but is it displayed behind another layer?&amp;nbsp; When you add it in XAML if it works try using MyMap.Layers.Insert(0, fs); so that the layer is added to the map on top.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 17:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703943#M18081</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2011-09-20T17:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703944#M18082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have.&amp;nbsp; The feature layer is added to the map layers collection.&amp;nbsp; It is there, but there isnothing in it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I debug into it, prior to adding to the map layers collection, and I see the "Graphics" collection is empty:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IEnumerable&amp;lt;Graphic&amp;gt; graphics = fs.Graphics;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can connect directly to the feature service using the browser.&amp;nbsp; I can query it, with the browser.&amp;nbsp; I can display it using the XAML code; but I cannot load the feature service programatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 19:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703944#M18082</guid>
      <dc:creator>HugoCardenas</dc:creator>
      <dc:date>2011-09-20T19:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703945#M18083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Also, I debug into it, prior to adding to the map layers collection, and I see the "Graphics" collection is empty:&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;That's normal. The layer is populated asynchrounously after it's initialized. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using fiddler may give you a clue about the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;At first glance, I don't see why the result would be different because you created the layer by code. Just check that the renderer is not null (fs.Renderer = LayoutRoot.Resources["AlertTypesRenderer"] as IRenderer;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 12:21:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703945#M18083</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-09-21T12:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703946#M18084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Dominique!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You are right, again...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The IRenderer was being returned null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To solve the problem, I set the "Name" property of the renderer in the XAML code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Before: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:UniqueValueRenderer x:Key="AlertTypesRenderer" Attribute="AlertType" &amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:UniqueValueRenderer x:Key="AlertTypesRenderer" x:Name="AlertTypesRenderer" Attribute="AlertType" &amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In C#, I reference the IRenderer property "Name", rather than the key:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fs.Renderer = AlertTypesRenderer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to all of you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2011 15:54:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703946#M18084</guid>
      <dc:creator>HugoCardenas</dc:creator>
      <dc:date>2011-09-21T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703947#M18085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having a hard time adding a feature layer in code behind.&amp;nbsp; I'm trying to add a feature layer based on the user's selection from a combobox:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; if (LayerComboBox.SelectedItem != "Select...")
&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;&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; FeatureLayer queryLayer = new FeatureLayer();
&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;&amp;nbsp;&amp;nbsp; string layerComboBoxItem;
&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;&amp;nbsp;&amp;nbsp; string layerID;
&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;&amp;nbsp;&amp;nbsp; layerComboBoxItem = LayerComboBox.SelectedItem.ToString();
&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;&amp;nbsp;&amp;nbsp; layerID = GetLayerID(layerComboBoxItem).ToString();
&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;&amp;nbsp;&amp;nbsp; queryLayer.ID = "QueryLayer";
&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;&amp;nbsp;&amp;nbsp; queryLayer.Url = "http://......./rest/services/QueryLayerService/MapServer/" + layerID;
&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;&amp;nbsp;&amp;nbsp; queryLayer.OutFields.Add("*");
&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;&amp;nbsp;&amp;nbsp; MyMap.Layers.Add(queryLayer);
&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;&amp;nbsp;&amp;nbsp; queryLayer.Initialize();
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it's adding it, but when I get to the next portion of the app (where I populate a combo box with field names):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;QueryFormCombo1.ItemsSource = (MyMap.Layers["QueryLayer"] as FeatureLayer).LayerInfo.Fields;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It gives me a null reference exception.&amp;nbsp; After looking into it, LayerInfo is null, and I can't seem to figure out how to use the FeatureLayerInfo.Get like it says in the tool tip.&amp;nbsp; Can someone point me in the right direction? Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:36:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703947#M18085</guid>
      <dc:creator>JonathanHouck</dc:creator>
      <dc:date>2021-12-12T05:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703948#M18086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;LayerInfos is null as long as the layer is not initialized.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hook up an handler to event 'Initialized' and populate your combo box at this time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 07:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703948#M18086</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-09-29T07:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically Adding a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703949#M18087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jonathan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Check out the following link.&amp;nbsp; I was having the same problem.&amp;nbsp; Here I described how to solve it (cf. the last post):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/40125-Is-there-a-feature-layer-quot-completed-quot-event"&gt;http://forums.arcgis.com/threads/40125-Is-there-a-feature-layer-quot-completed-quot-event&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hugo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 18:49:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/programatically-adding-a-feature-layer/m-p/703949#M18087</guid>
      <dc:creator>HugoCardenas</dc:creator>
      <dc:date>2011-09-29T18:49:40Z</dc:date>
    </item>
  </channel>
</rss>

