Ejemplo n.º 1
0
        partial void LoginButton_TouchUpInside(UIButton sender)
        {
            UIAlertController alert;

            alert = UIAlertController.Create("Profile", "What would you like to do?", UIAlertControllerStyle.ActionSheet);

            UIAlertAction register;

            register = UIAlertAction.Create("Register", UIAlertActionStyle.Default, (obj) => RegisterClass.Alert(this));
            alert.AddAction(register);

            UIAlertAction login;

            login = UIAlertAction.Create("Login", UIAlertActionStyle.Default, (obj) => LoginClass.Alert(this));
            alert.AddAction(login);

            UIAlertAction logout;

            logout = UIAlertAction.Create("Logout", UIAlertActionStyle.Default, (obj) => LogoutClass.Logout(this));
            alert.AddAction(logout);

            UIAlertAction cancel;

            cancel = UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null);
            alert.AddAction(cancel);

            this.PresentViewController(alert, true, null);
        }
Ejemplo n.º 2
0
        private void ProfileAction(object sender, System.EventArgs e)
        {
            AlertDialog.Builder profileAlert = new AlertDialog.Builder(this);
            profileAlert.SetTitle("Profile");
            profileAlert.SetMessage("What would you like to do?");


            profileAlert.SetPositiveButton("Register", (senderAlert, arg) => RegisterClass.Alert(this));
            profileAlert.SetNeutralButton("Login", (sendingAlert, arg) => LoginClass.Alert(this));
            profileAlert.SetNegativeButton("Logout", async(sendingAlert, arg) => await LogoutClass.Logout(this));


            Dialog dialog = profileAlert.Create();

            dialog.Window.SetGravity(GravityFlags.Bottom);
            dialog.Show();
        }