コード例 #1
0
        public override void Alert(AlertConfig config)
        {
            Device.BeginInvokeOnMainThread(() => {
                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();
                        }
                    }));
                    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();
                }
            });
        }
コード例 #2
0
 public async override void Alert(AlertConfig config)
 {
     if (uiCommand != null)
     {
         uiCommand.Cancel();
     }
     CoreDispatcher dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
     await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         try
         {
             var dialog = new MessageDialog(config.Message, config.Title);
             //OK Button
             UICommand okBtn = new UICommand(config.OkText);
             if (config.OnOk != null)
             {
                 okBtn.Invoked = command => config.OnOk();
             }
             dialog.Commands.Add(okBtn);
             uiCommand = dialog.ShowAsync();
         }
         catch (Exception ex)
         {
             //throw ex;
         }
     });
 }
コード例 #3
0
 public override void Alert(AlertConfig config) {
     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);
 }
コード例 #4
0
 public override void Alert(AlertConfig config) {
     Device.BeginInvokeOnMainThread(() => {
         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();
     });
 }
コード例 #5
0
        public override void Alert(AlertConfig config) {
            this.Dispatch(() =>  {
                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();
            });
        }
コード例 #6
0
        public override void Alert(AlertConfig config)
        {
            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);
        }
コード例 #7
0
        public override void Alert(AlertConfig config)
        {
            Device.BeginInvokeOnMainThread(() => {
                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();
            });
        }
コード例 #8
0
        public override void Alert(AlertConfig config)
        {
            this.Dispatch(() => {
                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();
            });
        }
コード例 #9
0
 public override void Alert(AlertConfig config) {
     Utils.RequestMainThread(() => 
         new AlertDialog
             .Builder(Utils.GetActivityContext())
             .SetMessage(config.Message)
             .SetTitle(config.Title)
             .SetPositiveButton(config.OkText, (o, e) => {
                 if (config.OnOk != null) 
                     config.OnOk();
             })
             .Show()
     );
 }
コード例 #10
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();
            });
        }
コード例 #11
0
 public override void Alert(AlertConfig config)
 {
     Utils.RequestMainThread(() =>
                             new AlertDialog
                             .Builder(Utils.GetActivityContext())
                             .SetMessage(config.Message)
                             .SetTitle(config.Title)
                             .SetPositiveButton(config.OkText, (o, e) => {
         if (config.OnOk != null)
         {
             config.OnOk();
         }
     })
                             .Show()
                             );
 }
コード例 #12
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();
            });
        }