Exemplo n.º 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();
        }
Exemplo n.º 2
0
        async Task Refresh()
        {
            IsBusy = true;

            await Task.Delay(2000);

            Coffee.Clear();

            var coffees = await InternetCoffeeService.GetCoffee();

            Coffee.AddRange(coffees);

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

            await Refresh();
        }