Share via


ContentDialog.ShowAsync 方法

定義

多載

ShowAsync()

開始異步操作以顯示對話框。

ShowAsync(ContentDialogPlacement)

開始異步操作,以顯示具有指定位置的對話框。

ShowAsync()

開始異步操作以顯示對話框。

public:
 virtual IAsyncOperation<ContentDialogResult> ^ ShowAsync() = ShowAsync;
/// [Windows.Foundation.Metadata.Overload("ShowAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<ContentDialogResult> ShowAsync();
[Windows.Foundation.Metadata.Overload("ShowAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<ContentDialogResult> ShowAsync();
function showAsync()
Public Function ShowAsync () As IAsyncOperation(Of ContentDialogResult)

傳回

顯示對話框的異步操作。 完成時,會傳回 ContentDialogResult

屬性

適用於

ShowAsync(ContentDialogPlacement)

開始異步操作,以顯示具有指定位置的對話框。

public:
 virtual IAsyncOperation<ContentDialogResult> ^ ShowAsync(ContentDialogPlacement placement) = ShowAsync;
/// [Windows.Foundation.Metadata.Overload("ShowAsyncWithPlacement")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement const& placement);
[Windows.Foundation.Metadata.Overload("ShowAsyncWithPlacement")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement);
function showAsync(placement)
Public Function ShowAsync (placement As ContentDialogPlacement) As IAsyncOperation(Of ContentDialogResult)

參數

placement
ContentDialogPlacement

值,指定對話框是否放在PopupRoot或其父系的視覺化樹狀結構中。

傳回

顯示對話框的異步操作。 完成時,會傳回 ContentDialogResult

屬性

備註

當您使用 ContentDialogPlacement.Popup 參數值呼叫這個方法時,對話框會根目錄在 XAML 視窗的 PopupRoot 元素中。 這是預設行為,相當於呼叫沒有參數的 ShowAsync 方法。

當您使用 ContentDialogPlacement.InPlace 參數值呼叫這個方法時:

  • 如果對話框有父元素,對話框就會根目錄在父系的可視化樹狀結構中。 它會與父系的其他子元素一起內嵌顯示,並參與父容器的配置。
  • 如果對話框沒有父代,對話框會回復為默認行為,並會顯示在PopupRoot中。

適用於