Ejemplo n.º 1
0
        async void  ExecuteLoadTrucksCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            try
            {
                Trucks.Clear();
                var trucks = await TruckStore.GetTrucksAsync(true);

                Trucks.ReplaceRange(trucks);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                MessagingCenter.Send(new MessagingCenterAlert
                {
                    Title   = "Error",
                    Message = "Unable to load Trucks.",
                    Cancel  = "OK"
                }, "message");
            }
            IsBusy = false;
        }