MessageDialog class

Expand
0 out of 2 rated this helpful - Rate this topic

MessageDialog class

[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.

ConstructorDescription
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.

MethodDescription
ShowAsync Begins an asynchronous operation showing a dialog.

 

Properties

The MessageDialog class has these properties.

PropertyAccess typeDescription

CancelCommandIndex

Read/writeGets 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.

Commands

Read-onlyGets the set of commands that appear in the command bar of the message dialog.

Content

Read/writeGets or sets the message to be displayed to the user.

DefaultCommandIndex

Read/writeGets 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.

Options

Read/writeGets or sets the options for a MessageDialog.

Title

Read/writeGets 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

Windows.UI.Popups
Windows::UI::Popups [C++]

Metadata

Windows.winmd

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD
How to change the style of the MessageDIalog

Hi there,There is a way to change the message dialog style to be first in diffrent cbackground color and diffrent color of the text?
And ofcourse change the direction to align right as should be in rtl languges?

4/1/2012