CoreWindow Class

Defines a window object and its input events, and basic user interface behaviors.

Syntax

public ref class CoreWindow sealed : ICoreWindow  

Remarks

New instances of this class are obtained by calling CoreApplication.CreateNewView and then inspecting the CoreWindow property on the returned CoreApplicationView instance. Or you can obtain existing CoreWindow instances for a running app from the CoreApplication.Views property, or by calling CoreWindow.GetForCurrentThread, as seen in the following example.

Example

C++

void MyCoreWindowEvents::Run() // this is an implementation of IFrameworkView::Run() used to show context
{
    CoreWindow::GetForCurrentThread()->Activate();

    /...

    CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
}  

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

This API is supported in native apps only.

Requirements

Namespace: Windows.UI.Core

Metadata: windows.winmd

See also

Reference

CoreWindow Members

Windows.UI.Core Namespace