CoreApplicationView class

CoreApplicationView class

Represents an app window and its thread.

Syntax


Public NotInheritable Class CoreApplicationView

Members

The CoreApplicationView class has these types of members:

Events

The CoreApplicationView class has these events.

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

 

Properties

The CoreApplicationView class has these properties.

PropertyAccess typeDescription

CoreWindow

Read-only

Gets the app window associated with the current view.

Dispatcher

Read-only

Gets the event message dispatcher associated with the current view.

IsComponent

Read-only

Gets whether the app was launched as a component that is embedded in another app by calling the LaunchAsync method.

IsHosted

Read-only

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

IsMain

Read-only

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

TitleBar

Read-only

Gets the title bar associated with the current view.

 

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();
    }

// ...
}

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Core
Windows::ApplicationModel::Core [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8

Namespace

Windows.ApplicationModel.Core
Windows::ApplicationModel::Core [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Standard)]
[Muse()]
[Version(0x06020000)]
[WebHostHidden()]

See also

Object
DirectX swap chain implementation sample
CoreApplication.CreateNewView
CoreApplication.GetCurrentView

 

 

Show:
© 2016 Microsoft