public Task ShowMessage(string title, string message, string positiveButtonTitle, Action positiveAction,
                                string negativeButtonTitle, Action negativeAction)
        {
            var dispatcher = TinyIoCContainer.Current.Resolve <IMvxViewDispatcher>();

            var tcs = new TaskCompletionSource <object>();

            dispatcher.RequestMainThreadAction(async() => AlertDialogHelper.Show(
                                                   Context.Activity,
                                                   title,
                                                   message,
                                                   positiveButtonTitle, () =>
            {
                if (positiveAction != null)
                {
                    positiveAction();
                }
                tcs.TrySetResult(null);
            },
                                                   negativeButtonTitle, () =>
            {
                if (negativeAction != null)
                {
                    negativeAction();
                }
                tcs.TrySetResult(null);
            }));

            return(tcs.Task);
        }
        public Task ShowMessage(string title, string message)
        {
            var dispatcher = TinyIoCContainer.Current.Resolve <IMvxViewDispatcher>();

            var tcs = new TaskCompletionSource <object>();

            dispatcher.RequestMainThreadAction(async() =>
                                               AlertDialogHelper.Show(Context.Activity, title, message, () => tcs.TrySetResult(null)));

            return(tcs.Task);
        }
Exemple #3
0
 private void ShowDialog()
 {
     AlertDialogHelper.Show(this, _title, _items, (s, e) => ReturnResult(e.Which));
 }