Select to view content in your preferred language

question when adding layers...

546
1
07-22-2010 12:34 AM
linusang
Emerging Contributor
hi,

i created a new layer , i add it to the map... the initialized event fires...
i removed the layer, but still keep a reference to it...
i add the same layer to map.. however this time the initialized event does not fire...

how can i listen to layers added to the map successfully for this scenario when i adding the same layer again?
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
Map Layers property is an observable collection so you can subscribe to CollectionChanged event to be aware of added/removed layers.
Also Layers have an 'IsInitialized' property, depending of this value you know if the Initialized event will be fired or not.
0 Kudos