/// <summary> /// When the user cancels the main menu, ask if they want to exit the sample. /// </summary> protected override void OnCancel(PlayerIndex playerIndex) { string message = "Do you really wish to quit? \n" + messages[rand.Next(messages.Length)]; MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen(message); confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted; ScreenManager.AddScreen(confirmExitMessageBox, playerIndex); }