Documentation
On this page

Interface · Application Lifecycle

DesktopWindow

Live desktop window created by DesktopApplication.

@sharpts/gui · SharpTS 572a2e31be0e

Members

closed

readonly closed: Promise<void>

Promise completed after the native window closes.

Type: Promise<void>

isDisposed

readonly isDisposed: boolean

Whether the native window and reactive root have been disposed.

Type: boolean

activate

activate(): void

Activates the window and requests foreground focus.

Remarks

Operating-system focus-stealing policies can prevent the window from receiving foreground focus.

Examples

TypeScript
window.activate();

close

close(): void

Requests that the native window close.

Remarks

Await closed when work must continue only after native close processing finishes.

Examples

TypeScript
window.close();
await window.closed;

dispose

dispose(): void

Disposes the native window and its reactive tree.

Remarks

Disposal is idempotent and completes the closed promise.

Examples

TypeScript
window.dispose();

findResource

findResource(key: string): DesktopResourceValue | null

Looks up a resource through the window and application dictionaries.

Remarks

Window resources take precedence over application resources.

Examples

TypeScript
const accent = window.findResource("AccentColor");

Source

src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:1051 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.