public override void Alert(AlertConfig config)
        {
            UIApplication.SharedApplication.InvokeOnMainThread(() => {
                if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
                {
                    var alert = UIAlertController.Create(config.Title ?? String.Empty, config.Message, UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, x => {
                        if (config.OnOk != null)
                        {
                            config.OnOk();
                        }
                    }));
                    this.Present(alert);
                }
                else
                {
                    var dlg = new UIAlertView(config.Title ?? String.Empty, config.Message, null, null, config.OkText);
                    if (config.OnOk != null)
                    {
                        dlg.Clicked += (s, e) => config.OnOk();
                    }

                    dlg.Show();
                }
            });
        }
        public override async void Alert(AlertConfig config)
        {
            var input = new InputDialog();
            await input.ShowAsync(config.Title, config.Message, config.OkText);

            if (config.OnOk != null)
            {
                config.OnOk();
            }
        }
Beispiel #3
0
 public override void Alert(AlertConfig config)
 {
     Utils.RequestMainThread(() =>
                             new AlertDialog
                             .Builder(this.getTopActivity())
                             .SetMessage(config.Message)
                             .SetTitle(config.Title)
                             .SetPositiveButton(config.OkText, (o, e) => {
         if (config.OnOk != null)
         {
             config.OnOk();
         }
     })
                             .Show()
                             );
 }
Beispiel #4
0
        public override void Alert(AlertConfig config)
        {
            this.Dispatch(() => {
                var alert = new CustomMessageBox {
                    Caption              = config.Title,
                    Message              = config.Message,
                    LeftButtonContent    = config.OkText,
                    IsRightButtonEnabled = false
                };
                if (config.OnOk != null)
                {
                    alert.Dismissed += (sender, args) => config.OnOk();
                }

                alert.Show();
            });
        }
        public override void Alert(AlertConfig config)
        {
            UIApplication.SharedApplication.InvokeOnMainThread(() => {
                if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) {
                    var alert = UIAlertController.Create(config.Title ?? String.Empty, config.Message, UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create(config.OkText, UIAlertActionStyle.Default, x => {
                        if (config.OnOk != null)
                            config.OnOk();
                    }));
                    this.Present(alert);
                }
                else {
                    var dlg = new UIAlertView(config.Title ?? String.Empty, config.Message, null, null, config.OkText);
                    if (config.OnOk != null)
                        dlg.Clicked += (s, e) => config.OnOk();

                    dlg.Show();
                }
            });
        }