Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
     }
 }