[This documentation is preliminary and is subject to change.]
Applies to: Metro style apps only
Represents a dialog. The dialog has a command bar that can support up to three commands. If you don't specify any commands, then a default command is added to close the dialog.
The dialog dims the screen behind it and blocks touch events from passing to the app's canvas until the user responds.
Message dialogs should be used sparingly, and only for critical messages or simple questions that must block the user's flow.
Syntax
var messageDialog = new Windows.UI.Popups.MessageDialog(string); var messageDialog = new Windows.UI.Popups.MessageDialog(string, string);
Attributes
- ActivatableAttribute(Windows.UI.Popups.IMessageDialogFactory, NTDDI_WIN8)
- MarshalingBehaviorAttribute(Standard)
- VersionAttribute(NTDDI_WIN8)
Members
The MessageDialog class has these types of members:
Constructors
The MessageDialog class has these constructors.
| Constructor | Description |
|---|---|
| MessageDialog(String) | Initializes a new instance of the MessageDialog class to display an untitled message dialog that can be used to ask your user simple questions. |
| MessageDialog(String, String) | Initializes a new instance of the MessageDialog class to display a titled message dialog that can be used to ask your user simple questions. |
Methods
The MessageDialog class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| ShowAsync | Begins an asynchronous operation showing a dialog. |
Properties
The MessageDialog class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write | Gets or sets the index of the command you want to use as the cancel command. This is the command that fires when users press the ESC key. | |
| Read-only | Gets the set of commands that appear in the command bar of the message dialog. | |
| Read/write | Gets or sets the message to be displayed to the user. | |
| Read/write | Gets or sets the index of the command you want to use as the default. This is the command that fires by default when users press the ENTER key. | |
| Read/write | Gets or sets the options for a MessageDialog. | |
| Read/write | Gets or sets the title to display on the dialog, if any. |
Requirements
|
Minimum supported client | Windows 8 Release Preview |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
Build date: 5/22/2012
