I´m looking for the best way to create a table of contents for a DynamicMapServiceLayer. I´d like to be able to toggle visibility independently for each sub-layer within this DynamicMapServiceLayer, not just for the entire DynamicMapServiceLayer. All examples I found, and also the "Legend"-class in the Toolkit, seem to operate on the ServiceLayer-level.
Is there any sample code for this? Or is it best to start from scratch?
At this time, the legend control provided by the toolkit doesn't manage the visibility of the sublayers.
You are considering to support that in a future version but there is no guarantee yet.
Thanks for the info Dominique.
It seems that I can just add the sublayers directly instead of the entire service layer. That way I can still use the Legend-Class. It also allows me to reorder layers if necessary.