<?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: ArcGISLocalFeatureLayer Path set via app.config file or code-behind? in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659674#M3354</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This can not be done in XAML, you will have to do this in code behind. As you discovered, Path is not a Dependency property.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2012 13:21:21 GMT</pubDate>
    <dc:creator>BKuiper</dc:creator>
    <dc:date>2012-10-22T13:21:21Z</dc:date>
    <item>
      <title>ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659673#M3353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like to have the Path property for an ArcGISLocalFeatureLayer be a value that is not hard-coded. Is it possible to set the value in code-behind or somehow use a value from the app.config file directly in xaml to set it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried binding to an app.config values using the following technique:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://dean-o.blogspot.com/2009/10/wpf-binding-appconfig-settings-in-xaml.html" rel="nofollow" target="_blank"&gt;http://dean-o.blogspot.com/2009/10/wpf-binding-appconfig-settings-in-xaml.html&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://www.codearsenal.net/2012/03/accessing-appconfig-properties-from.html#.UIGz6NeaZ1o" rel="nofollow" target="_blank"&gt;http://www.codearsenal.net/2012/03/accessing-appconfig-properties-from.html#.UIGz6NeaZ1o&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I get the following error ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;A 'Binding' cannot be set on the 'Path' property of type 'ArcGISLocalFeatureLayer'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 19:18:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659673#M3353</guid>
      <dc:creator>KeithGemeinhart</dc:creator>
      <dc:date>2012-10-19T19:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659674#M3354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This can not be done in XAML, you will have to do this in code behind. As you discovered, Path is not a Dependency property.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 13:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659674#M3354</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2012-10-22T13:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659675#M3355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any pointers on how to do that in code behind?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 13:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659675#M3355</guid>
      <dc:creator>KeithGemeinhart</dc:creator>
      <dc:date>2012-10-22T13:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659676#M3356</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;Please see the API reference on ArcGISLocalFeatureLayer for more information and code examples: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client.Local~ESRI.ArcGIS.Client.Local.ArcGISLocalFeatureLayer.html" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client.Local~ESRI.ArcGIS.Client.Local.ArcGISLocalFeatureLayer.html&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 12:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659676#M3356</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2012-10-23T12:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659677#M3357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wasn't sure if LocalFeatureService was the way to go or not. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 12:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659677#M3357</guid>
      <dc:creator>KeithGemeinhart</dc:creator>
      <dc:date>2012-10-23T12:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659678#M3358</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;Actually, the ArcGISLocalFeatureLayer will automatically create the LocalFeatureService in the background (if it is not already running) when you set the Path property and the layer is initialized (either by adding the layer to the map or by you calling Initialize). Alternatively you can work with the LocalFeatureClass directly - which would give you greater control over when the service lifecycle in relation to the lifecycle of your application and also over additional properties which may be available on the service but not on the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 13:07:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659678#M3358</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2012-10-23T13:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659679#M3359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you point to any resources that describe the service lifecycle? I've implemented it as shown below, but my first stab at it yielded an exception ("Path property cannot be changed when the service is running."). Now that I've added the stop &amp;amp; start calls before setting the path, it works fine, but that seems to be really inefficient - especially since the service has apparently started once already. There was a noticeable delay on the start call. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to attach and set the path earlier in the process? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;esri:ArcGISLocalFeatureLayer ID="DtedFootprint" LayerName="DtedFootprint" Path="C:\\xxxxx\\yyyyy\\maps\\DtedFootprint.mpk" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var dted = _view.MapControl.Layers["DtedFootprint"] as GraphicsLayer;
dted.Initialized += new EventHandler&amp;lt;EventArgs&amp;gt;(dted_Initialized);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
void dted_Initialized(object sender, EventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var layer = sender as ArcGISLocalFeatureLayer;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.Service.Stop();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.Service.Path = System.IO.Path.Combine(sPackageLocation, sDtedPackage);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.Service.Start();
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659679#M3359</guid>
      <dc:creator>KeithGemeinhart</dc:creator>
      <dc:date>2021-12-12T03:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISLocalFeatureLayer Path set via app.config file or code-behind?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659680#M3360</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;From your code example what will likely happen is that the XAML layer initialization will begin first and start the LocalFeatureService creation (which in turn will start the LocalServer if it is not already started). Once the localserver/service are ready and the layer is initialized your code then appears to stop that service, set the path and starts the service again. If I'm right, this means you're incurring two service startup delays. These local services typically start quickly but it's recommended to try to start them as early as possible in the lifetime of the app, and asynchronously so that when the user starts interacting with the map the layers are ready to go. It is not advised to change the path of local feature service (you'll likely want to set different properties) and definitely not with the same feature layer in the map (many properties could be different), unless you were going to reinitialize the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're trying to achieve the flexibility of managing the local services in code then I think it would be better to handle the layer management in code too. There is an exmaple of this in the API Reference: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client.Local~ESRI.ArcGIS.Client.Local.LocalFeatureService.html"&gt;http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client.Local~ESRI.ArcGIS.Client.Local.LocalFeatureService.html&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But you have highlighted to me that we should review the documentation on local layer/service management and where possible be more explicit about the behaviour and recommended patterns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 09:56:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/arcgislocalfeaturelayer-path-set-via-app-config/m-p/659680#M3360</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2012-10-24T09:56:15Z</dc:date>
    </item>
  </channel>
</rss>

