Namespace: SpawnDev.SpawnJS.JSObjects
Inherits: Event
Source: JSObjects/WindowControlsOverlayGeometryChangeEvent.cs
MDN Reference: WindowControlsOverlayGeometryChangeEvent on MDN
The WindowControlsOverlayGeometryChangeEvent interface of the Window Controls Overlay API is passed to geometrychange when the size or visibility of a desktop Progress Web App's title bar region changes. https://developer.mozilla.org/en-US/docs/Web/API/WindowControlsOverlayGeometryChangeEvent
| Signature | Description |
|---|---|
WindowControlsOverlayGeometryChangeEvent(SpawnJSObjectReference _ref) |
Deserialization constructor |
| Property | Type | Access | Description |
|---|---|---|---|
Visible |
bool |
get | A Boolean that indicates whether the window controls overlay is visible or not. |
| Method | Return Type | Description |
|---|---|---|
TitlebarAreaRect() |
DOMRectReadOnly |
A DOMRect representing the position and size of the title bar region. |
SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:
- Properties and methods use PascalCase (e.g.,
readyStatebecomesReadyState)- Events use ActionEvent with
+=/-=(e.g.,addEventListener("click", fn)becomesOnClick += handler)- Async methods return
Task<T>instead ofPromise<T>- Objects should be disposed with
usingstatements- Access via
JS.Get<WindowControlsOverlayGeometryChangeEvent>(...)or constructornew WindowControlsOverlayGeometryChangeEvent(...)
if ("windowControlsOverlay" in navigator) {
navigator.windowControlsOverlay.addEventListener(
"geometrychange",
(event) => {
if (event.visible) {
const rect = event.titlebarAreaRect;
// Do something with the coordinates of the title bar area.
}
},
);
}