I'm wondering if anybody has idea for how to best group distinct layers -- even layers of differing types like DynamicLayer, WFSLayer, etc. The goal in mind is that they could be visually represented together in a TOC component and they could be toggled on and off as a group in the TOC.
The TOC component which comes with the out of the box Flex Viewer is setup to do this for ArcGISDynamicMapServiceLayers -- which have the layerInfo property that informs of the parent/child relationships.
The question is -- has anybody done this before and if so, what is the best way to accomplish this? I was considering creating a LayerGroup object which extends the base Layer object and has a layerInfo property that stores a custom LayerInfo object -- similar to how the WMSLayerInfo is used to store parent/child relationships for WMSLayers.