I want to use LayerInfo for an ArcGISDynamicMapServiceLayer object after the MainPage is loaded. I used the MainPage Loaded event and MyMap Loaded event. In the event handler, I try to use the Layers attribute on the ArcGISDynamicMapServiceLayer object to retrieve its layer's info. However, the Layers info is null. So, my question is, which event should I use to make sure the layerinfo has been loaded successfully.
ArcGISDynamicMapServiceLayer.Layers is available after the layer has been initialized.
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e)
{
var l = sender as ArcGISDynamicMapServiceLayer;
if (l.Layers == null) return;
foreach (var s in l.Layers)
{
//layer info here.
}
}