MessageBox.Show for Windows Phone 7

I need MessageBox.Show (), but with enhanced functionality: the built-in message box for Windows Phone 7 will not display arbitrary buttons, just OK or cancel, I need, for example, YesNo. I need a Show method that will only return when the user clicks a button. I tried to make my own inbox pop up. The problem is that it is asynchronous, like everything in the user interface in WP7, and I cannot block the UI thread, because the user interface is responsible for handling button events. I saw the ChildWindow example for WP7, but it was also asynchronous, I have to have the Show () method, which returns only when the user clicks. Any suggestions? Some DoEvents () can help me a lot, but in WP7 there is no such method: (

+7
source share
3 answers

You can use the XNA Guide.BeginShowMessageBox () to display a MessageBox with custom buttons. Here is a tutorial on how to use it.

Note that the MessageBoxIcon parameter does not select an icon on WP7, instead it selects a notification sound when a message box is displayed.

EDIT: Unfortunately, I did not read your synchronous requirements before I posted. Perhaps you can set a flag to stop everything that you want to prevent, and reset after the user has made a choice.

+6
source

I found this when I was looking for something similar, but ended up using the message built into it. This will definitely give you the ability to create custom buttons.

Windows Phone 7 Custom Message Block

+2
source

Use a canvas that has everything you need. Then just use the visibility property to open it.

+1
source

All Articles