public void ShowAlert(string message, string btnOkTitle, EEditProfileAlertType alertType) { (Context as Activity)?.RunOnUiThread(() => { AlertDialog.Builder alert = new AlertDialog.Builder(Context); alert.SetMessage(message); alert.SetPositiveButton(btnOkTitle, (senderAlert, args) => { AlertButtonClick?.Invoke(alertType); }); Dialog dialog = alert.Create(); dialog.Show(); }); }
public void ShowAlert(string message, string btnOkTitle, EEditProfileAlertType alertType) { var alertVC = UIAlertController.Create("", message, UIAlertControllerStyle.Alert); alertVC.AddAction(UIAlertAction.Create(btnOkTitle, UIAlertActionStyle.Default, action => { AlertButtonClick?.Invoke(alertType); })); var currVC = GetViewController?.Invoke(this); currVC?.PresentViewController(alertVC, true, null); }