ApplicationViewSwitcher.TryShowAsViewModeAsync 方法

定义

重载

TryShowAsViewModeAsync(Int32, ApplicationViewMode)

在所需视图模式下,将视图显示为独立视图。

TryShowAsViewModeAsync(Int32, ApplicationViewMode, ViewModePreferences)

在具有指定选项的所需视图模式下,将视图显示为独立视图。

TryShowAsViewModeAsync(Int32, ApplicationViewMode)

在所需视图模式下,将视图显示为独立视图。

public:
 static IAsyncOperation<bool> ^ TryShowAsViewModeAsync(int viewId, ApplicationViewMode viewMode);
/// [Windows.Foundation.Metadata.Overload("TryShowAsViewModeAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<bool> TryShowAsViewModeAsync(int const& viewId, ApplicationViewMode const& viewMode);
[Windows.Foundation.Metadata.Overload("TryShowAsViewModeAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<bool> TryShowAsViewModeAsync(int viewId, ApplicationViewMode viewMode);
function tryShowAsViewModeAsync(viewId, viewMode)
Public Shared Function TryShowAsViewModeAsync (viewId As Integer, viewMode As ApplicationViewMode) As IAsyncOperation(Of Boolean)

参数

viewId
Int32

int

要显示的窗口的 ID。

viewMode
ApplicationViewMode

窗口的所需视图模式。

返回

如果调用成功,则异步返回 true ; 如果 不是,则为 false。

属性

Windows 要求

设备系列
Windows 10 Creators Update (在 10.0.15063.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v4.0 中引入)

注解

如果此方法成功,则会在原始窗口旁边创建新窗口。 它只能从 ASTA (核心 UI) 线程调用。

新窗口具有自己的 UI 线程 (ASTA) 和关联的 CoreWindow。 开发人员应使用线程安全方法在 Windows 之间进行通信,例如适用于 JavaScript 应用的 window.postMessageCoreDispatcher (CoreWindow.Dispatcher) 消息传送给 C# 和 C++ 开发人员。

适用于

TryShowAsViewModeAsync(Int32, ApplicationViewMode, ViewModePreferences)

在具有指定选项的所需视图模式下,将视图显示为独立视图。

public:
 static IAsyncOperation<bool> ^ TryShowAsViewModeAsync(int viewId, ApplicationViewMode viewMode, ViewModePreferences ^ viewModePreferences);
/// [Windows.Foundation.Metadata.Overload("TryShowAsViewModeWithPreferencesAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<bool> TryShowAsViewModeAsync(int const& viewId, ApplicationViewMode const& viewMode, ViewModePreferences const& viewModePreferences);
[Windows.Foundation.Metadata.Overload("TryShowAsViewModeWithPreferencesAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<bool> TryShowAsViewModeAsync(int viewId, ApplicationViewMode viewMode, ViewModePreferences viewModePreferences);
function tryShowAsViewModeAsync(viewId, viewMode, viewModePreferences)
Public Shared Function TryShowAsViewModeAsync (viewId As Integer, viewMode As ApplicationViewMode, viewModePreferences As ViewModePreferences) As IAsyncOperation(Of Boolean)

参数

viewId
Int32

int

要显示的窗口的 ID。

viewMode
ApplicationViewMode

窗口的所需视图模式。

viewModePreferences
ViewModePreferences

所需视图模式的首选设置。

返回

如果调用成功,则异步返回 true ; 如果 不是,则为 false。

属性

Windows 要求

设备系列
Windows 10 Creators Update (在 10.0.15063.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v4.0 中引入)

注解

如果此方法成功,则会在原始窗口旁边创建新窗口。 它只能从 ASTA (核心 UI) 线程调用。

新窗口具有自己的 UI 线程 (ASTA) 和关联的 CoreWindow。 开发人员应使用线程安全方法在 Windows 之间进行通信,例如适用于 JavaScript 应用的 window.postMessageCoreDispatcher (CoreWindow.Dispatcher) 消息传送给 C# 和 C++ 开发人员。

适用于