Select to view content in your preferred language

ESRI TOC Control

2953
10
07-26-2011 06:59 AM
RobertBrodsky
Deactivated User
Hi All;
I am using the TOC control in my application and need to chance which layer is active or inactive programmatically. Any ideas?

Thank you in advance.
0 Kudos
10 Replies
DominiqueBroux
Esri Frequent Contributor

I'd like to also bind Layer.Description or Description (see my xaml).
None of these work. I also notice that Description is never populated.
I see it in the arcgis/rest/services reference but this does not get populated..


Binding to 'Description' should work in all cases (i.e Description of the LayerItemViewModel)
Binding to 'Layer.Description' should work if the layer is implementing the 'Description' property (true with ArcGISDynamicMapServiceLayer/ArcGISTiledMapServiveLayer, but false with FeatureLayer).


Note: I was debugging the legend refresh event handler and perusing the e.LayerItem
to try and find Description with my value....
Do you know if this is available via the Object Model?


When you bind to 'Layer.Description', it means that you are using the layer properties which are depending on the type of layer. You can find the documentation here:
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISDyna...
or http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISImag...
or http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureLay...
...

On another hand, a binding to 'Description' means the 'Description' property of the LayerItemViewModel which is depending on the implementation of ILegendSupport for the type of layer.

For example for a feature layer Description is ~ to Layer.LayerInfo.Description.
0 Kudos