Select to view content in your preferred language

Legend / Layers

627
1
03-15-2011 09:08 AM
DavidAshton
Frequent Contributor
I noticed in the Silverlight Viewer 1.0 the legend has a feature where you can select a layer and then that layer becomes the active layer for selecting features, querying, etc.

I was wondering how to take advantage of this? 

I created a drop down list so the user can select an active layer and then work with the query or spatial selection tools but I would like to eliminate my drop down list and just take advantage of the legend active layer function. 

Is there an example or documentation on how to grab the active/selected/highlighted layer in the legend

Right now my code looks like

QueryTask queryTask = new QueryTask((Layers.SelectedItem as FeatureLayer).Url);

But I would like to drop the ((Layers.SelectedItem as FeatureLayer).Url) and replace it with some code that is bound to the active layer in the legend.

Thanks
David
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
0 Kudos