// Public public void UpdateMenu() { if (MyMap != null && MenuItems.Items.Count < 1) { LayerCollection lc = new LayerCollection(); foreach (EsriMap3D.EsriMapLayer mapLayer in MyLayers) { lc.Add(mapLayer.MyLayer); if (mapLayer.MyLayer is ArcGISDynamicMapServiceLayer) { ArcGISDynamicMapServiceLayer dLayer = (ArcGISDynamicMapServiceLayer)mapLayer.MyLayer; foreach (LayerInfo dLayerInfo in dLayer.Layers) MyLayerMapping.Add(dLayerInfo, dLayer); } } MenuItems.ItemsSource = lc.Reverse(); } }