Core​Application​View Core​Application​View Core​Application​View Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

Prerelease. Represents an app window and its thread.

public : sealed class CoreApplicationView : ICoreApplicationView, ICoreApplicationView2, ICoreApplicationView3, ICoreApplicationView5, ICoreApplicationView6public sealed class CoreApplicationView : ICoreApplicationView, ICoreApplicationView2, ICoreApplicationView3, ICoreApplicationView5, ICoreApplicationView6Public NotInheritable Class CoreApplicationView Implements ICoreApplicationView, ICoreApplicationView2, ICoreApplicationView3, ICoreApplicationView5, ICoreApplicationView6
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Note

This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).

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


ref class MyFrameworkView : public IFrameworkView
{
// ...
virtual void Initialize(
        _In_ CoreApplicationView^ applicationView
        )
    {
        applicationView->Activated +=
            ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &MyFrameworkView::OnActivated);
    }

// ...

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

// ...
}

Properties

CoreWindow CoreWindow CoreWindow

Gets the app window associated with the current view.

public : CoreWindow CoreWindow { get; }public CoreWindow CoreWindow { get; }Public ReadOnly Property CoreWindow As CoreWindow
Value
CoreWindow CoreWindow CoreWindow

The app window.

Attributes

Dispatcher Dispatcher Dispatcher

Gets the event message dispatcher associated with the current view.

public : CoreDispatcher Dispatcher { get; }public CoreDispatcher Dispatcher { get; }Public ReadOnly Property Dispatcher As CoreDispatcher
Value
CoreDispatcher CoreDispatcher CoreDispatcher

The event message dispatcher.

Attributes

DispatcherQueue DispatcherQueue DispatcherQueue

Prerelease. Gets the DispatcherQueue for the window.

public : DispatcherQueue DispatcherQueue { get; }public DispatcherQueue DispatcherQueue { get; }Public ReadOnly Property DispatcherQueue As DispatcherQueue
Value
DispatcherQueue DispatcherQueue DispatcherQueue

A DispatcherQueue instance.

Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

The DispatcherQueue allows you to run your tasks on the thread associated with the DispatcherQueue instance. To make UI changes on a CoreApplicationView from a different thread, use the DispatcherQueue from that CoreApplicationView.

IsComponent IsComponent 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.

public : PlatForm::Boolean IsComponent { get; }public bool IsComponent { get; }Public ReadOnly Property IsComponent As bool
Value
PlatForm::Boolean bool bool

True if the app was launched as a component that is embedded in another app; false otherwise.

Attributes

IsHosted IsHosted IsHosted

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

public : PlatForm::Boolean IsHosted { get; }public bool IsHosted { get; }Public ReadOnly Property IsHosted As bool
Value
PlatForm::Boolean bool bool

If true, this app view is hosted; if false, it is not.

Attributes

IsMain IsMain IsMain

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

public : PlatForm::Boolean IsMain { get; }public bool IsMain { get; }Public ReadOnly Property IsMain As bool
Value
PlatForm::Boolean bool bool

If true, this app view is the main; if false, it is not.

Attributes

Properties Properties Properties

Gets properties that the app can associate with the view.

public : IPropertySet Properties { get; }public IPropertySet Properties { get; }Public ReadOnly Property Properties As IPropertySet
Value
IPropertySet IPropertySet IPropertySet

The property bag.

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

Properties stored here are guaranteed to have a lifetime equal to the CoreApplicationView.

TitleBar TitleBar TitleBar

Gets the title bar associated with the current view.

public : CoreApplicationViewTitleBar TitleBar { get; }public CoreApplicationViewTitleBar TitleBar { get; }Public ReadOnly Property TitleBar As CoreApplicationViewTitleBar
Value
CoreApplicationViewTitleBar CoreApplicationViewTitleBar CoreApplicationViewTitleBar

The title bar associated with the current view.

Attributes

Events

Activated Activated Activated

Occurs when the view is activated.

public : event TypedEventHandler Activatedpublic event TypedEventHandler ActivatedPublic Event Activated
Attributes
See Also

HostedViewClosing HostedViewClosing HostedViewClosing

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

public : event TypedEventHandler HostedViewClosingpublic event TypedEventHandler HostedViewClosingPublic Event HostedViewClosing
Attributes

Remarks

Handling this event provides an opportunity to perform cleanup tasks such as closing files, flushing buffers to disk, and so on.

See Also