private void CitiesList_OnTap(object sender, System.Windows.Input.GestureEventArgs e) { CityListItem selectedItem = this.citiesList.SelectedItem as CityListItem; this._viewModel.SelectItem(selectedItem); this.PickItem(selectedItem); }
private void PickItem(CityListItem item) { // ISSUE: reference to a compiler-generated field if (item == null || this.CityPicked == null) { return; } // ISSUE: reference to a compiler-generated field this.CityPicked(this, item.City); }
public List <CityListItem> GetCitiesByName(string cityName) { using (var ctx = new ApplicationDbContext()) { var cities = ctx.Cities.Where(e => e.Name.Contains(cityName)).ToList(); foreach (var city in cities) { var foundCity = new CityListItem { ID = city.ID, Name = city.Name, State = city.State }; searchResults.Add(foundCity); } return(searchResults); } }