Represents a system-managed container for the content of an app.
public : sealed class AppWindow
public sealed class AppWindow
Public NotInheritable Class AppWindow
Windows 10 requirements
Windows 10, version 1903 (introduced v10.0.18362.0)
Windows.Foundation.UniversalApiContract (introduced v8)
AppWindow is currently in preview. This means you can submit apps that use AppWindow to the Store, but some platform and framework components are known to not work with AppWindow (see Limitations).
An AppWindow can be used to represent a displayed portion of a Windows Runtime app when it has more than one window. It is similar in concept to an ApplicationView, but not the same in behavior and lifetime.
To obtain an object of this type, call AppWindow.TryCreateAsync.
To connect content to your AppWindow, call ElementCompositionPreview.SetAppWindowContent.
You can only connect XAML content to your AppWindow, there is no support for native DirectX or Holographic content.
A sample that shows how to use the AppWindow API can be found in the Windows Universal Samples repo on GitHub under Samples/AppWindow.
Limitations in the current preview version of AppWindow include (this is a non-exhaustive list):
- Any API that uses the GetForCurrentView pattern is not working for AppWindow since the CurrentView refers to the ApplicationView which is a separate entity from the AppWindow.
- Fullscreen media playback is unavailable in MediaElement or MediaPlayerElement.
- MessageDialog will not be modal to the correct window, recommendation is to use ContentDialog instead.
- WebView is not fully supported. You can use an in-proc WebView, but anything outside of static HTML content may or may not work properly.
- If you set the Window.Current.Content property in XAML, it destroys all the XAML content in your AppWindow. Avoid using this as a pattern to reset your content when suspending your app if you use AppWindow.
- Smooth Window Resize is not working for AppWindows. The frame and the content will resize independently, which can look unpolished when content layout is slow.
- DisplayInformation is not accessible for AppWindow. If your AppWindow is on a different monitor than your ApplicationView you will not be able to query for the correct display information.
- UserInteractionMode cannot be set for an AppWindow.
- Print dialogs (2D and 3D) will not be parented to the correct window.
- AppWindow cannot detect when edge gestures are being invoked.
- AppWindow cannot be used to satisfy an activation request through ActivationViewSwitcher.
|Content Content Content Content||
Gets the app content currently attached to the window.
|DispatcherQueue DispatcherQueue DispatcherQueue DispatcherQueue||
Gets the dispatcher queue for the app window.
|Frame Frame Frame Frame||
Gets the frame for the app window.
|IsVisible IsVisible IsVisible IsVisible||
Gets a value that indicates whether the window can be seen on a display.
|PersistedStateId PersistedStateId PersistedStateId PersistedStateId||
Gets or sets a string that identifies this window for tracking and saving state.
|Presenter Presenter Presenter Presenter||
Gets the presenter for the app window.
|Title Title Title Title||
Gets or sets the displayed title of the app window.
|TitleBar TitleBar TitleBar TitleBar||
Gets the title bar of the app window.
|UIContext UIContext UIContext UIContext||
Gets the UI context for the app window.
|WindowingEnvironment WindowingEnvironment WindowingEnvironment WindowingEnvironment||
Gets the windowing environment for the app window.
|Changed Changed Changed Changed||
Occurs when a property of the app window has changed.
|Closed Closed Closed Closed||
Occurs when the app window has been closed.
|CloseRequested CloseRequested CloseRequested CloseRequested||
Occurs after the window starts to close, but before it is closed and before the Closed event occurs.