Hi,I am trying to set the VisibleLayers property in MapPrinter.InitializePrintMap (in your Print example). if (toLayer != null)
{
toLayer.InitializationFailed += (s, e) => { }; // to avoid crash if bad layer
toLayer.Initialized += (s, e) => {
CopyLayerVisibility((Layer)s, toLayer);
};
printMap.Layers.Add(toLayer);
}
This loops though the feature layers in the main maps dynamic layer building an list of visible ones and then sets them on the print maps dynamic layer [ToLayer]. i.e.ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer printdynamicService = (ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer)ToLayer;
printdynamicService.VisibleLayers = visibleLayerList.ToArray();
This doesn't work when the printmap is first initialized. If I call the same code sometime later from PreparePages (called by clicking the scale fixed checkbox) then it works.Matt