Answers for "xamarin forms show alert"

3

xamarin forms show alert

await App.Current.MainPage.DisplayAlert("Title", "message content", "OK");
Posted by: Guest on October-19-2020
0

xamarin native display alert android

TaskCompletionSource<bool> taskCompletionSource;
taskCompletionSource = new TaskCompletionSource<bool>();

Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.Instance);
AlertDialog alert = dialog.Create();
alert.SetTitle("Title");
alert.SetMessage("Complex Alert");
alert.SetButton("OK", (c, ev) =>
                {
                  // Ok button click task 
                  Console.WriteLine("Okay was clicked");
                  taskCompletionSource.SetResult(true);
                });
alert.SetButton2("CANCEL", (c, ev) =>
                 {
                   Console.WriteLine("Cancel was clicked");
                   taskCompletionSource.SetResult(false);
                 });
alert.Show();
Posted by: Guest on October-04-2020

Code answers related to "xamarin forms show alert"

Browse Popular Code Answers by Language