CoreApplicationView Class

Definition

Represents an app window and its thread.

C#
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class CoreApplicationView
Inheritance
Object CoreApplicationView
Attributes

Windows requirements

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

Remarks

The following code snippet demonstrates the activation of the CoreApplicationView and the associated CoreWindow in a view provider implementation.

C++/WinRT
struct App : implements<App, IFrameworkViewSource, IFrameworkView>
{
...
    void Initialize(CoreApplicationView const& applicationView)
    {
        applicationView.Activated({this, &App::OnActivated });
    }

    void OnActivated(CoreApplicationView const& /* applicationView */, IActivatedEventArgs const& /* args */)
    {
        // Activate the application window, making it visible and enabling it to receive events.
        CoreWindow::GetForCurrentThread().Activate();
    }
}

Version history

Windows version SDK version Value added
1703 15063 Properties
1709 16299 DispatcherQueue

Properties

CoreWindow

Gets the app window associated with the current view.

Dispatcher

Gets the event message dispatcher associated with the current view.

DispatcherQueue

Gets the DispatcherQueue for the window.

IsComponent

Gets whether the app was launched as a component that is embedded in another app.

This property is reserved for internal use and is not intended to be used in your code.

IsHosted

Gets the value that indicates whether this app view is hosted or not.

IsMain

Gets a value that indicates whether this app view is the main app view or not.

Properties

Gets properties that the app can associate with the view.

TitleBar

Gets the title bar associated with the current view.

Events

Activated

Occurs when the view is activated.

HostedViewClosing

Indicates that the hosted view is closing. Provides an opportunity for hosted window scenarios to defer the tear down of the hosted view.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also