I need to do some processing on the feature layer after the map is loaded.How can I capture Map Loaded event complete?After the map is loaded I need to do the followingprivate void ProjectFeatures()
{
FeatureLayer newFeaturelayer;
newFeaturelayer = MyMap.Layers["myFeaturelayer"] as FeatureLayer;
Graphic feature = new ESRI.ArcGIS.Client.Graphic();
int[] statuses = MyWebServiceProxy.GetAllStatus(UserInfo.username,1);
for (int i = 0; i < 12; i++)
{
feature = newFeaturelayer.Graphics;
if (statuses == 0)
{
feature.Attributes["Status"] = "Off";
feature.Symbol = this.MainGrid.Resources["MyRedFillSymbol"] as SimpleFillSymbol;
}
else
{
feature.Attributes["Status"] = "On";
feature.Symbol = this.MainGrid.Resources["MyGreenFillSymbol"] as SimpleFillSymbol;
}
}
}
If I call this in private void MyMap_Loaded(object sender, RoutedEventArgs e) { MyMap.Rotation = 90; ProjectFeatures(); }I get System.ArgumentOutofRange exception at feature = newFeaturelayer.Graphics;Where will be the appropriate place to invoke this function.