Esempio n. 1
0
        public static void RunTask(Activity activity, ProgressDialog dialog, Func <Task> func)
        {
            Task.Run(async() =>
            {
                try
                {
                    await func();
                }
                catch (Exception ex)
                {
                    AlertDialogHelper.DisplayAlert(activity, "ERROR", ex.Message);
                }

                Dismiss(activity, dialog);
            });
        }
Esempio n. 2
0
        public static void RunTask(Activity activity, ProgressDialog dialog, Action action)
        {
            Task.Run(() =>
            {
                try
                {
                    action();
                }
                catch (Exception ex)
                {
                    AlertDialogHelper.DisplayAlert(activity, "ERROR", ex.Message);
                }

                Dismiss(activity, dialog);
            });
        }