public void AddLocation(Location point, bool useradded) { MovedLocation el = new MovedLocation(point); el.PropertyChanged += Location_PropertyChanged; el.EnableEdit = true; MovedLocations.Add(el); if (MovedLocations.Count > 1) { Locations = new LocationCollection(MovedLocations); } OnUpdate(useradded); }
void Location_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { MovedLocation el = sender as MovedLocation; if (e.PropertyName.Equals("Current")) { Locations = new LocationCollection(MovedLocations); OnUpdate(true); } if (e.PropertyName.Equals("Remove")) { if (el != null) { MovedLocations.Remove(el); Locations = new LocationCollection(MovedLocations); OnUpdate(true); } } }