CoreApplicationView class

5 out of 6 rated this helpful - Rate this topic

Represents an app window and its thread.

Syntax

Public NotInheritable Class CoreApplicationView  
    Inherits Object

Attributes

MarshalingBehaviorAttribute(Standard)
MuseAttribute()
VersionAttribute(NTDDI_WIN8)
WebHostHiddenAttribute()

Members

The CoreApplicationView class has these types of members:

Events

The CoreApplicationView class has these events.

EventDescription
Activated Occurs when the view is activated.

 

Methods

The CoreApplicationView class inherits methods from the Object class.

Properties

The CoreApplicationView class has these properties.

PropertyAccess typeDescription

CoreWindow

Read-onlyGets the app window associated with the current view.

IsHosted

Read-onlyGets the value that indicates whether this app view is hosted or not.

IsMain

Read-onlyGets a value that indicates whether this app view is the main app view or not.

 

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

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

See also

DirectX swap chain implementation sample
CoreApplication.CreateNewView
CoreApplication.GetCurrentView

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.