private void TileOverlays_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Reset) { foreach (TileOverlay tileOverlay in tileOverlays.Select(m => m.Key).ToList()) { RemoveTileOverlay(tileOverlay); } } else if (e.Action == NotifyCollectionChangedAction.Add) { foreach (TileOverlay tileOverlay in e.NewItems) { AddTileOverlay(tileOverlay); } } else if (e.Action == NotifyCollectionChangedAction.Remove) { foreach (TileOverlay tileOverlay in e.OldItems) { RemoveTileOverlay(tileOverlay); } } }
private void Markers_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Reset) { foreach (Marker marker in markers.Select(m => m.Key).ToList()) { RemoveMarker(marker); } } else if (e.Action == NotifyCollectionChangedAction.Add) { foreach (Marker marker in e.NewItems) { AddMarker(marker); } } else if (e.Action == NotifyCollectionChangedAction.Remove) { foreach (Marker marker in e.OldItems) { RemoveMarker(marker); } } }