示例#1
0
        private void Select_Click(object sender, EventArgs e)
        {
            AlertDialog.Builder alert = new AlertDialog.Builder(this.Context);
            alert.SetTitle("Make " + groupname + " your current group?");

            //Set current group
            alert.SetPositiveButton("Confirm", (senderAlert, args) =>
            {
                //This is where current group is set
                DB_Singleton db  = DB_Singleton.Instance;
                UserGroup active = db.SearchGroup(groupname);
                db.ChangeActiveGroup(active);
            });

            //Close dialog
            alert.SetNegativeButton("Cancel", (senderAlert, args) =>
            {
                Dismiss();
            });
            Dialog dialog = alert.Create();

            dialog.Show();
            Dismiss();
        }