<?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: layer.IsInitialized and InititializationFailure event in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277218#M7251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you hover over the IsInitialized property in code it states...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; "Returns true if the layer has been initialized."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but the layer has not been initialized, it has failed to initialize.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Oct 2011 15:13:09 GMT</pubDate>
    <dc:creator>ChrisSmith</dc:creator>
    <dc:date>2011-10-28T15:13:09Z</dc:date>
    <item>
      <title>layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277217#M7250</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;On occasion one or more of my feature layers fails to initialize, I receive the InitializationFailed event; but the IsInitialized property is set to true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I noted the comment at the end of the below thread that states IsInitialized only indicates that the layer attempted to initialize - doesn't sound logical to state something is initialized when it isn't?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/14244-...-about-layer-isinitialized-properties?highlight=IsInitialized"&gt;http://forums.arcgis.com/threads/14244-...-about-layer-isinitialized-properties?highlight=IsInitialized&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want the user to be able to click a button/some kind of control that will reinitialize the layer but this doesn't work, I am assuming it doesn't work because the logic in the feature layer is checking if the layer IsInitialized and if it is then the code does nothing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above scenario can happen in our environment for a number of reasons, one being that the user has forgotten to log into the internet (yes we have to log in to use the internet &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions on how to initialize a feature layer that has previously failed initialization?&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;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 15:21:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277217#M7250</guid>
      <dc:creator>ChrisSmith</dc:creator>
      <dc:date>2011-10-27T15:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277218#M7251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you hover over the IsInitialized property in code it states...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; "Returns true if the layer has been initialized."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but the layer has not been initialized, it has failed to initialize.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 15:13:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277218#M7251</guid>
      <dc:creator>ChrisSmith</dc:creator>
      <dc:date>2011-10-28T15:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277219#M7252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know the answer to your question Chris.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I have questions like this what I do is to use something like &lt;/SPAN&gt;&lt;A href="http://www.reflector.net/"&gt;Reflector&lt;/A&gt;&lt;SPAN&gt; to see what is really going on.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Oct 2011 12:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277219#M7252</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2011-10-29T12:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277220#M7253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;InitializationFailure is a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;property&lt;/SPAN&gt;&lt;SPAN&gt;, not an event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that if there is a failure, the initialized&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt; event&lt;/SPAN&gt;&lt;SPAN&gt; fires, but after this property is set to an exception, and before InitializationFailed &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;event &lt;/SPAN&gt;&lt;SPAN&gt;fires.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/36578-FeatureLayer.FromJson-thows-exception?p=123635&amp;amp;viewfull=1#post123635"&gt;http://forums.arcgis.com/threads/36578-FeatureLayer.FromJson-thows-exception?p=123635&amp;amp;viewfull=1#post123635&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 01:48:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277220#M7253</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2011-10-30T01:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277221#M7254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following blog post might be helpful in troubleshooting layers that failed to initialize: &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Layer_Initialized event, you still want to check for the following values:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var l = sender as Layer;
if(!l.IsInitialized || l.InitializationFailure != null) return; //layer failed to intialize.
//otherwise, continue.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are subscribed to Layer.InitializationFailed event, you know that an error occured. InitializationFailure will be set.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:29:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277221#M7254</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T13:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277222#M7255</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;Thanks for the responses, apologies for not getting back sooner - app releases &amp;amp; deployments taking priority &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reflector is indeed a great app&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;InitializationFailure, InitializedFailed &amp;amp; IsInitialized - understand they are events properties etc - I posted at the end of the day and in a rush so may have been a typo in the original posting &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the scenario...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) ItemControl ItemsSource is bound to a LayerCollection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Layers are loaded at runtime in code behind from a config file into the LayerCollection, the available layers change by user group&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) There maybe 20+ layers available for the user to select from&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) Each layer item in the ItemControl contains a ToggleControl to switch layer visibility&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;problem...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) 1 layer out of 20 fails to initialize &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) the ToggleControl that is bound to the layer when toggled to set the layer visible fails to set the layer visible because it is not Initialized&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) if the layer has failed to initialize then the ToggleControl needs to be able to reinitialize the layer - this wont work as you are not able to reinitialize the layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I need is for the ToggleControl when toggled to detect initialization failure of a layer and for the layer to be deleted from the LayerCollection if it failed to initialize. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Layer will then need to be recreated and inserted into the LayerCollection at the same index&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a few things to try - will get back at some point if I get a solution that doesnt involve the user reloading the page&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still baffled by the IsInitialized meaning it only attempted to initialize :S &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and not being able to try and reinitialize the layer in code &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2011 10:33:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277222#M7255</guid>
      <dc:creator>ChrisSmith</dc:creator>
      <dc:date>2011-11-25T10:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277223#M7256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;just in case anyone is interested, this is how I implemented it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Added a trigger to InvokeCommandAction on my ToggleControl, this fires on click event&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Created ReInitialiseLayerCommand on ViewModel &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-----a) this recreates the layer, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-----b) deletes the failed one from LayerCollection &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-----c) inserts the new one at the original collection index&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-----d) raises relevant propertychanged event&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Created ConditionalExpression on trigger, this is bound to Layer.InitializationFailure property using a ValueConverter to convert from Exception to boolean, so when this evaluates to true it will invoke the&amp;nbsp; ReInitialiseLayerCommand when the user clicks the ToggleControl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) Added Image (indicates no internet connection/network problem) to content of ToggleControl, visibility = collapsed - &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) Bound the Image to Layer.InitializeFailure using ValueConverter when evaluates to true Image is set visible indicating to the user that there is an issue with the layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A little convoluted but works well&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 09:37:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277223#M7256</guid>
      <dc:creator>ChrisSmith</dc:creator>
      <dc:date>2011-12-01T09:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: layer.IsInitialized and InititializationFailure event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277224#M7257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you have to do anything special with Caching?&amp;nbsp; I got the code all set up to follow your approach and checked that the layer is being removed from the layer collection, and the map control is re-loading the layer when I remove it and re-add it, but it never succeeds in initializing.&amp;nbsp; To test it, I am turning off the service and refreshing my REST cache on my server, then I load the Silverlight app which indicates the layer fails to initialize, then I start the service and refresh the REST cache again, then I fire the event to remove and re-add the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like the silverlight client is caching the REST state of the service and not re-querying it.&amp;nbsp; If I try this in reverse (run the Silverlight app while the service is running, then turn off the service) the Silverlight app continues to display the now dead service data even if I completely re-load the page that the SL app is on.&amp;nbsp; If I close the browser and open an new browser window, then it figures out that the service isn't running any more.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So how can I tell the map control to clear it's local cache data when I'm trying to dynamically re-add a service?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John H.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2012 20:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layer-isinitialized-and-inititializationfailure/m-p/277224#M7257</guid>
      <dc:creator>BobbyRadakovich</dc:creator>
      <dc:date>2012-04-19T20:46:39Z</dc:date>
    </item>
  </channel>
</rss>

