Dela via


ApplicationView Class

Definition

Represents the active application view and associated states and behaviors.

public ref class ApplicationView sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ApplicationView final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ApplicationView
Public NotInheritable Class ApplicationView
Inheritance
Object Platform::Object IInspectable ApplicationView
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

A window (also called an app view) is the displayed portion of a Windows Runtime app. On Windows, a user's screen can have up to 4 windows of variable width displayed simultaneously. They do not overlap, and their top and bottom edges touch the top and bottom edges of the screen. There may be non-window areas between adjacent windows.

The window is not the same thing as the current page of the application. It is better thought of as the container of the pages; you can use the window reference in your program for all the pages of the application.

Each window has a corresponding CoreWindow that represents the UI processing thread (including the core input handlers and event dispatcher) for the window.

You can use the properties (or methods, for JavaScript) of the window in configuring your pages. For example: the Orientation property tells you whether the window is portrait or landscape; for Windows the AdjacentToLeftDisplayEdge property tells you whether the left edge of the screen is the left border of the window; and the isFullScreen method tells you whether the window uses the entire screen. For examples of using these methods, see the Application Views sample.

To obtain an object of this type, call ApplicationView.GetForCurrentView.

Note

Do not use the value returned in the ApplicationView.Value property when creating a page layout. This method is deprecated and may not be available in future releases.

Version history

Windows version SDK version Value added
1703 15063 IsViewModeSupported
1703 15063 TryConsolidateAsync
1703 15063 TryEnterViewModeAsync(ApplicationViewMode)
1703 15063 TryEnterViewModeAsync(ApplicationViewMode,ViewModePreferences)
1703 15063 ViewMode
1903 18362 ClearAllPersistedState
1903 18362 ClearPersistedState
1903 18362 GetDisplayRegions
1903 18362 PersistedStateId
1903 18362 UIContext
1903 18362 WindowingEnvironment

Properties

AdjacentToLeftDisplayEdge

Gets a value that indicates whether the current window is in close proximity to the left edge of the screen.

AdjacentToRightDisplayEdge

Gets a value that indicates whether the current window is in close proximity to the right edge of the screen.

DesiredBoundsMode

Gets a value that indicates the bounds used by the framework to lay out the contents of the window (app view).

FullScreenSystemOverlayMode

Gets or sets a value that indicates how an app in full-screen mode responds to edge swipe actions.

Id

Gets the ID of the window (app view).

IsFullScreen

Note

IsFullScreen may be altered or unavailable for releases after Windows 10. Instead, use IsFullScreenMode.

Gets a value that indicates whether the window touches both the left and right sides of the display.

IsFullScreenMode

Gets a value that indicates whether the app is running in full-screen mode.

IsOnLockScreen

Gets whether the window (app view) is on the Windows lock screen.

IsScreenCaptureEnabled

Gets or sets whether screen capture is enabled for the window (app view).

Orientation

Gets the current orientation (landscape or portrait) of the window (app view) with respect to the display.

PersistedStateId

Gets or sets a string that identifies this view for tracking and saving state.

PreferredLaunchViewSize

Gets or sets the size that the app launches with when the ApplicationView.PreferredLaunchWindowingMode property is set to PreferredLaunchViewSize, except in cases where the system manages the window size directly.

PreferredLaunchWindowingMode

Gets or sets a value that indicates the windowing mode the app launches with.

SuppressSystemOverlays

Note

SuppressSystemOverlays may be altered or unavailable for releases after Windows 10. Instead, use TryEnterFullScreenMode and FullScreenSystemOverlayMode.

Gets or sets a value indicating whether or not system overlays (such as overlay applications or the soft steering wheel) should be shown.

TerminateAppOnFinalViewClose

Indicates whether the app terminates when the last window is closed.

Title

Gets or sets the displayed title of the window.

TitleBar

Gets the title bar of the app.

UIContext

Gets the context identifier for the view.

Value

Note

ApplicationView static methods may be altered or unavailable for releases after Windows 8.1. Instead, use ApplicationView.GetForCurrentView to get an ApplicationView object.

Gets the state of the current window (app view).

ViewMode

Gets the app view mode for the current view.

VisibleBounds

Gets the visible region of the window (app view). The visible region is the region not occluded by chrome such as the status bar and app bar.

WindowingEnvironment

Gets the windowing environment for the view.

Methods

ClearAllPersistedState()

Clears any properties the system has saved for any view PersistedStateId for the given application.

ClearPersistedState(String)

Clears any properties the system has saved for the view with the specified identifier for the given application.

ExitFullScreenMode()

Takes the app out of full-screen mode.

GetApplicationViewIdForWindow(ICoreWindow)

Gets the window ID that corresponds to a specific CoreWindow managed by the app.

GetDisplayRegions()

Returns the collection of display regions available for the view.

GetForCurrentView()

Gets the view state and behavior settings of the active application.

IsViewModeSupported(ApplicationViewMode)

Determines whether the specified view mode is supported on the current device.

SetDesiredBoundsMode(ApplicationViewBoundsMode)

Sets a value indicating the bounds used by the framework to lay out the contents of the window (app view).

SetPreferredMinSize(Size)

Sets the smallest size, in effective pixels, allowed for the app window.

ShowStandardSystemOverlays()

Shows system UI elements, like the title bar, over a full-screen app.

TryConsolidateAsync()

Tries to hide the current app view. This method is a programmatic equivalent to a user closing the app.

TryEnterFullScreenMode()

Attempts to place the app in full-screen mode.

TryEnterViewModeAsync(ApplicationViewMode, ViewModePreferences)

Attempts to change the app view to the specified view mode using the specified options.

TryEnterViewModeAsync(ApplicationViewMode)

Attempts to change the app view to the specified view mode.

TryResizeView(Size)

Attempts to change the size of the view to the specified size in effective pixels.

TryUnsnap()

Note

TryUnsnap may be altered or unavailable for releases after Windows 8.1. Apps can be continuously resized, but cannot be snapped, starting in Windows 8.1. Also, ApplicationView static methods may be altered or unavailable for releases after Windows 8.1. Use ApplicationView.GetForCurrentView to get an ApplicationView object.

Attempts to unsnap a previously snapped app. This call will only succeed when the app is running in the foreground.

TryUnsnapToFullscreen()

Attempts to unsnap a previously snapped app.

Events

Consolidated

Occurs when the window is removed from the list of recently used apps, or if the user executes a close gesture on it.

VisibleBoundsChanged

This event is raised when the value of VisibleBounds changes, typically as a result of the status bar, app bar, or other chrome being shown or hidden.

Applies to

See also