Dev Center - Metro style apps > Samples >
WinRT MessageDialog sample

WinRT MessageDialog sample

This sample demonstrates how to display a dialog box in C++/CX or in C#, using the MessageDialog and UICommand API. The Windows.UI.Popups namespace contains the MessageDialog class. You can use this class to present a message that the user must acknowledge before continuing.


Select a language
 
 
 
 
 
(2)
1,244 times
2/9/2012
E-mail Twitter del.icio.us Digg Facebook
Add To Favorites
Description
Browse Code
Q and A (1)
Sign in to Ask a Question


  • MessageBox
    3 Posts | Last Post October 14, 2011
    • I've been trying out the new environment - and was wondering - is there really no direct replacement to Message Boxes? The sample here demonstrates the same idea, but it's kind of complicated. Is there no one line command to display a message to the user?
      
      Your help is most appreciated.
    • In WinRT developer preview, it seems that there is no direct replacement for message boxes yet. Maybe it is not documented yet, or in a future release, don't know.
      Note that the approach of MessageDialog let the programmer use concurrency, and some background task can easily be scheduled while the message dialog is displayed with ShowAsync. Using non bloking UI is a general trend in WinRT.
    • I've a confirmation that there is no direct replacement to messageboxes.
      "The commands method provides more flexibility at the expense of simplicity. Rather than using many MessageBoxes you may want to look into less modal options (such as flyouts) to keep a more fluid user experience."
      
      http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/d01036cf-b37d-4338-bb62-58119b64ab78/