CoreWindow Class

Stellt die Windows Store-App mit Eingabeereignissen und grundlegendem Benutzeroberflächenverhalten dar.

Syntax


public sealed class CoreWindow : ICoreWindow

Attribute

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

Member

CoreWindowKlasse hat diese Membertypen:

Ereignisse

CoreWindowKlasse hat diese Ereignisse.

EreignisBeschreibung
Activated Is fired when the window completes activation or deactivation.
AutomationProviderRequested Is fired when a request for an automation handler is generated.
CharacterReceived Is fired when a new character is received by the input queue.
Closed Is fired when the app terminates.
InputEnabled Occurs when input is enabled or disabled for the Windows Store app.
KeyDown Is fired when a non-system key is pressed.
KeyUp Is fired when a non-system key is released after a press.
PointerCaptureLost Occurs when a pointer moves to another Windows Store app.
PointerEntered Occurs when a pointer moves into the bounding box of the Windows Store app.
PointerExited Occurs when the pointer moves outside the bounding box of the Windows Store app.
PointerMoved Occurs when a pointer moves within the bounding box of the Windows Store app.
PointerPressed Occurs when a mouse button is clicked, or a touch or pen contact is detected, within the bounding rectangle of the Windows Store app.
PointerReleased Occurs when a mouse button is released, or a touch or pen contact is lifted, within the bounding rectangle of the Windows Store app.
PointerWheelChanged Occurs when the wheel button is rotated.
SizeChanged Is fired when the window size is changed.
TouchHitTesting Occurs when a touch contact area intersects the bounding rectangle (or polygon) of a window that is registered for touch hit testing.
VisibilityChanged Is fired when the window visibility is changed.

 

Methoden

The CoreWindow Klasse hat diese Methoden. Es erbt auch Methoden von Object Klasse.

MethodeBeschreibung
Activate Activates the window.
Close Closes a secondary window and exits the message loop.
GetAsyncKeyState Returns the state of a virtual key asynchronously.
GetForCurrentThread Gets the CoreWindow instance for the currently active thread.
GetKeyState Gets the state of a key.
ReleasePointerCapture Disables pointer capture for the Windows Store app.
SetPointerCapture Enables pointer capture for the Windows Store app.

 

Eigenschaften

Der CoreWindowKlasse hat diese Eigenschaften.

EigenschaftZugriffstypBeschreibung

AutomationHostProvider

SchreibgeschütztGets the automation provider assigned to this window.

Bounds

SchreibgeschütztGets the bounding rectangle of the window.

CustomProperties

SchreibgeschütztGets the set of custom properties for the window.

Dispatcher

SchreibgeschütztGets the event dispatcher for the window.

FlowDirection

Lese-/SchreibzugriffGets or sets the horizontal origin of the window's reading order alignment.

IsInputEnabled

Lese-/SchreibzugriffGets or sets a value that indicates whether input is enabled for the Windows Store app.

IsKeyboardInputEnabled

Lese-/Schreibzugriff

KeyboardInputBuffer

Lese-/Schreibzugriff

PointerCursor

Lese-/SchreibzugriffGets or sets the cursor used by the Windows Store app.

PointerPosition

SchreibgeschütztGets the client coordinates of the pointer.

Visible

SchreibgeschütztGets a value that indicates whether the window is visible.

 

Hinweise

Neue Instanzen dieser Klasse werden abgerufen durch Aufruf von CoreApplication.CreateNewView und anschließender Prüfung der Eigenschaft CoreWindow in der zurückgegebenen CoreApplicationView-Instanz. Oder Sie rufen vorhandene CoreWindow-Instanzen für eine laufende App aus der Eigenschaft CoreApplication.Views ab bzw. rufen CoreWindow.GetForCurrentThread auf, wie im folgenden Beispiel gezeigt.


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

    /...

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

Hinweis  : Es handelt sich nicht um eine agile Klasse. Daher müssen Sie das Threadingmodell und das Marshallingverhalten berücksichtigen. Weitere Informationen finden Sie im Thema zu Threading und Marshalling (C++/CX).

Windows Phone 8

Diese API wird nur in systemeigenen Apps unterstützt.

Anforderungen

Mindestens unterstützter Client

Windows 8 [Nur Windows Store-Apps]

Mindestens unterstützter Server

Windows Server 2012 [Nur Windows Store-Apps]

Mindestens unterstütztes Telefon

Windows Phone 8 [nur systemeigene Apps]

Namespace

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

Metadaten

Windows.winmd

Siehe auch

CoreApplicationView
CoreApplication.CreateNewView
CoreApplication.Views

 

 

Anzeigen:
© 2014 Microsoft