private async Task ExecuteSearchBeersCommand ()
		{
			if (IsBusy)
				return;

			using (Xamarin.Insights.TrackTime("BeerSearch", "searchTerm", searchTerm)) {

				IsBusy = true;

				try {
					//TODO fill in your BreweryDB API Key here
					var client = new BreweryDB.BreweryDbClient ("b7da1c5827026053a276f0dbe2234962");
					var results = await client.Beers.Search(searchTerm);

					Beers.Clear();

					if (results.Data.Count > 0) {
						foreach (var beer in results.Data) {
							Beers.Add(beer);            
						}  
						return;
					}
				} catch (Exception ex) {
					Acr.UserDialogs.UserDialogs.Instance.ShowError(ex.Message);
				} finally {
					IsBusy = false;
				}
			}
		}
 public BreweryDBService()
 {
     client = new BreweryDB.BreweryDbClient("a956af587b434c4c89ef18c7bbd2fac9");
 }
Beispiel #3
0
 public BreweryDBService()
 {
     client = new BreweryDB.BreweryDbClient("a956af587b434c4c89ef18c7bbd2fac9");
 }