Exemple #1
0
        async Task Add()
        {
            var name = await App.Current.MainPage.DisplayPromptAsync("Name", "Name of coffee");

            var roaster = await App.Current.MainPage.DisplayPromptAsync("Roaster", "Roaster of coffee");

            await InternetCoffeeService.AddCoffee(name, roaster);

            await Refresh();
        }
Exemple #2
0
        async Task Refresh()
        {
            IsBusy = true;

            await Task.Delay(2000);

            Coffee.Clear();

            var coffees = await InternetCoffeeService.GetCoffee();

            Coffee.AddRange(coffees);

            IsBusy = false;
        }
Exemple #3
0
        async Task Remove(Coffee coffee)
        {
            await InternetCoffeeService.RemoveCoffee(coffee.Id);

            await Refresh();
        }