public void setLocations(ObservableCollection<String> locations, bool isRemovable) { Locations.Clear(); if (locations == null) return; for(int i = locations.Count() - 1; i >= 0; i--) { PopupLocationItem location = new PopupLocationItem(locations[i], LocationSelectedCommand, LocationRemovedCommand); location.IsRemovable = isRemovable; Locations.Insert(0, location); } }
private void popupViewModel_LocationRemoved(object sender, PopupLocationItem e) { FavoriteLocations.Remove(e.Name); }
private void popupViewModel_LocationSelected(object sender, PopupLocationItem location) { if(((String)popup.Tag).Equals("historyPopup")) { Index = popupViewModel.getIndexOfSelectedLocation(); } Location = location.Name; hidePopup(); }