Select to view content in your preferred language

Some Silverlight asynchronous processing issues

605
1
02-22-2011 04:11 AM
PhilDegler
Emerging Contributor
Hello,

I'm having a little trouble getting the "sublayer list" functionality to work properly as it is presented under mapping in the Silverlight interactive sdk.

What is happening is that occasionally the GetDefaultVisibleLayers function will run before my dynamic services' layers collection is populated causing an error.  This does not happen very often and I believe it's related to some asynchronous process running which does not allow me to guarantee that the layers collection is populated when the dynamic services' "initialized" event is fired off.  The initialized event is where the GetDefaultVisibleLayers function is being called like in the SDK example.

Is there any workaround for this or some check that I can put into place to make sure that the layers collection is populated prior to calling GetDefaultVisibleLayers?

Another general question that I have is also related to asynchronous processing.  We have a feature layer based on a SQL server query.  What I want to do is establish a where clause for the service based on some default selections in other silverlight controls that are databound using RIA services.  I need to make sure that these controls are populated with data prior to building my feature layer where clause.  Are there any tried and true methods to setting up some kind of process order whereby I can wait on building the where clause until I know the other controls are populated?

Thanks,

Phil
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
You can check for IsInitialized property, this should have already been set to true or false when Initialized event fires.

As for your other question, I'm not sure if Loaded or LayoutUpdated are the events you need to know whether all controls drawn. If I understood your question right, it's a Silverlight question? Maybe you can also post at their forum.
0 Kudos