MyMap.Layers.CollectionChanged += (a, b) => { //breakpoint here }; } private void Button_Click(object sender, RoutedEventArgs e) { MyMap.Layers.RemoveAt(MyMap.Layers.Count -1); }
map.Layers.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Layers_CollectionChanged);
void Layers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { //some code here }