ApplicationWindowBase
Description
- Derived from
-
Disposable abstract
IApplicationWindow - Extended by
Abstract base class for IApplicationWindow implementations.
To implement an application window, the following steps are necessary:
-
Implement all abstract members.
-
Use KeyCodeMap (preferably in the constructor) to establish a mapping between key codes of the native API and the KeyboardKey enumeration.
-
Setup event handlers using the native API and call into the
On*
handler methods. -
Override IApplicationWindow.Resolution to support high-DPI rendering. The default implementation returns 96 DPI.
When implementing a top-level application window, the following no-op virtual members should be overridden:
Public / Attributes
IsRecreateNativeWindow
Is the native window being re-created in a call to INativeWindowRecreate.RecreateNativeWindowIfNecessary?
Protected / Methods
OnMessage_Win32
Processes a window message of the WIN32 API and calls the required handler methods.
If this method returns true
, the WIN32 window procedure should return 0
.
RecreateNativeWindow
Re-creates the native window.
- RenderException
-
If a graphics subsystem error has occurred.
Protected / Attributes
dirty
Can be set to true
in order to make the next call to IApplicationWindow.ProcessSystemMessages return true
once.
resolution
The window resolution, in DPI.
This field will be set to 96
by the constructor of this class. It will be updated by OnMessage_Win32 when receiving a WM_DPICHANGED
message.