ContentDialog.ShowAsync ContentDialog.ShowAsync ContentDialog.ShowAsync ContentDialog.ShowAsync Method

Definition

Overloads

ShowAsync() ShowAsync() ShowAsync() ShowAsync()

Begins an asynchronous operation to show the dialog.

ShowAsync(ContentDialogPlacement) ShowAsync(ContentDialogPlacement) ShowAsync(ContentDialogPlacement) ShowAsync(ContentDialogPlacement)

Begins an asynchronous operation to show the dialog with the specified placement.

ShowAsync() ShowAsync() ShowAsync() ShowAsync()

Begins an asynchronous operation to show the dialog.

public : IAsyncOperation<ContentDialogResult> ShowAsync()
IAsyncOperation<ContentDialogResult> ShowAsync() const;
public IAsyncOperation<ContentDialogResult> ShowAsync()
Public Function ShowAsync() As IAsyncOperation(Of ContentDialogResult)

Returns

An asynchronous operation showing the dialog. When complete, returns a ContentDialogResult.

ShowAsync(ContentDialogPlacement) ShowAsync(ContentDialogPlacement) ShowAsync(ContentDialogPlacement) ShowAsync(ContentDialogPlacement)

Begins an asynchronous operation to show the dialog with the specified placement.

public : IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement)
IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement) const;
public IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement)
Public Function ShowAsync(placement As ContentDialogPlacement) As IAsyncOperation(Of ContentDialogResult)

Parameters

placement
ContentDialogPlacement ContentDialogPlacement

A value that specifies whether the dialog is placed in the PopupRoot or in its parent's visual tree.

Returns

An asynchronous operation showing the dialog. When complete, returns a ContentDialogResult.

Additional features and requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

When you call this method with the ContentDialogPlacement.Popup parameter value, the dialog is rooted in the PopupRoot element of the XAML Window. This is the default behavior, and is equivilent to calling the ShowAsync method with no parameters.

When you call this method with the ContentDialogPlacement.InPlace parameter value:

  • If the dialog has a parent element, the dialog is rooted in the parent's visual tree. It's shown inline along with the parent’s other child elements, and participates in the parent container’s layout.
  • If the dialog has no parent, the dialog falls back to the default behavior and is shown in the PopupRoot.