MessageDialog.ShowAsync | showAsync method

Applies to Windows and Windows Phone

Begins an asynchronous operation showing a dialog.

Syntax


messageDialog.showAsync().done( /* Your success and error handlers */ );

Parameters

This method has no parameters.

Return value

Type: IAsyncOperation<IUICommand>

An object that represents the asynchronous operation. For more on the async pattern, see Asynchronous programming in the Windows Runtime.

Remarks

In some cases, the system may close the dialog, like when people invoke an app contract when the dialog is showing. IAsyncOperation(IUICommand).GetResults returns either the command selected which destroyed the dialog, or an empty command.

To launch subsequent dialogs or other modal UI such as file pickers after a dialog has been closed, use the then or done functions of the Promise object. You cannot launch modal UI from within a UICommand callback.

Calling showAsync while the splash screen is being displayed

  • In Windows 8: Your app can call showAsync from within the activated handler (the onactivated event or the CoreApplicationView.Activated event), and paint operations then occur behind the app's splash screen.

  • Beginning in Windows 8.1: Windows suppresses painting while the app is behind the splash screen to reduce wasteful operations. Your app should not call showAsync from within the activated handler, but should instead wait for the visibility changed notification (the visibilitychange event or the CoreWindow.VisibilityChanged event).

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

See also

MessageDialog

 

 

Show:
© 2014 Microsoft