private void AddGameButton_Click(object sender, EventArgs e) { AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater inflater = LayoutInflater; View view = inflater.Inflate(Resource.Layout.popup_new_game_layout, null); EditText opponentName = view.FindViewById <EditText>(Resource.Id.opponentInputText); CheckBox isHomeCheckBox = view.FindViewById <CheckBox>(Resource.Id.isHomeCheckBox); //string text = MainViewModel.Instance.GetDb().ToString(); builder.SetView(view) .SetPositiveButton("OK", (s, args) => { //MainViewModel.Instance.GetData(); myViewModel.CreateGame(opponentName.Text, DateTime.Now, isHomeCheckBox.Checked); }) .SetNegativeButton("Cancel", (s, args) => { //MainViewModel.Instance.DataBase(); }); builder.Show(); }