Udostępnij za pośrednictwem


ApplicationViewSwitcher.TryShowAsViewModeAsync Method

Definition

Overloads

TryShowAsViewModeAsync(Int32, ApplicationViewMode)

Displays a view as a standalone view in the desired view mode.

TryShowAsViewModeAsync(Int32, ApplicationViewMode, ViewModePreferences)

Displays a view as a standalone view in the desired view mode with the specified options.

TryShowAsViewModeAsync(Int32, ApplicationViewMode)

Displays a view as a standalone view in the desired view mode.

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)

Parameters

viewId
Int32

int

The ID of the window to display.

viewMode
ApplicationViewMode

The desired view mode for the window.

Returns

Asynchronously returns true if the call succeeds; false if it does not.

Attributes

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v4.0)

Remarks

If this method succeeds, a new window is created next to the original window. It can only be called from an ASTA (core UI) thread.

The new window has its own UI thread (ASTA) and associated CoreWindow. Developers should use thread-safe methods for communication between the windows, such as window.postMessage for JavaScript apps and the CoreDispatcher (CoreWindow.Dispatcher) messaging for C# and C++ developers.

Applies to

TryShowAsViewModeAsync(Int32, ApplicationViewMode, ViewModePreferences)

Displays a view as a standalone view in the desired view mode with the specified options.

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)

Parameters

viewId
Int32

int

The ID of the window to display.

viewMode
ApplicationViewMode

The desired view mode for the window.

viewModePreferences
ViewModePreferences

Preferred settings for the desired view mode.

Returns

Asynchronously returns true if the call succeeds; false if it does not.

Attributes

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v4.0)

Remarks

If this method succeeds, a new window is created next to the original window. It can only be called from an ASTA (core UI) thread.

The new window has its own UI thread (ASTA) and associated CoreWindow. Developers should use thread-safe methods for communication between the windows, such as window.postMessage for JavaScript apps and the CoreDispatcher (CoreWindow.Dispatcher) messaging for C# and C++ developers.

Applies to