Here is the method I use. By the way, for better user convenience and consistency, use the words “delete” and “cancel” rather than “confirm” or “cancel”.
public static MessagePromptResult Show(string messageBoxText, string caption, string button1, string button2) { int? returned = null; using (var mre = new System.Threading.ManualResetEvent(false)) { string[] buttons; if (button2 == null) buttons = new string[] { button1 }; else buttons = new string[] { button1, button2 }; Microsoft.Xna.Framework.GamerServices.Guide.BeginShowMessageBox( caption, messageBoxText, buttons, 0,
You will need to add a link to Microsoft.Xna.Framework.GamerServices in your project.
source share