예제 #1
0
        public async Task ExecuteAdminDataCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            //Delay for 5 seconds
            //await Task.Delay(5000);
            GetAdminData.ChangeCanExecute();
            var showAlert = false;

            try
            {
                AdminData.Clear();
                var empList = GetEmployeeData();
                foreach (var data in empList)
                {
                    AdminData.Add(data);
                }
            }
            catch (Exception ex)
            {
                showAlert = true;
                //Xamarin.Insights.Report(ex);
            }
            finally
            {
                IsBusy = false;
                GetAdminData.ChangeCanExecute();
            }

            if (showAlert)
            {
                await page.DisplayAlert("Uh Oh :(", "Unable to gather Data.", "OK");
            }
        }