예제 #1
0
        public virtual async Task OnAccept()
        {
            Exception error = null;

            try {
                StartBusy();

                error = await Validate();

                if (error == null)
                {
                    var task = DoAccept();
                    if (task != null)
                    {
                        await task;
                    }
                }
            }
            catch (Exception exc) {
                Debug.ExceptionCaught(exc);
                error = exc;
            }
            finally {
                EndBusy();
            }

            if (error != null)
            {
                await Alerts.ErrorAlert(error.Message);

                return;
            }

            await Navigator.PopPage();
        }