Table of Contents

Class StandaloneWindow

Namespace
PluginUI
Assembly
PluginUI.dll

Top-level window hosting a UIHost: standalone versions of plug-ins, test benches, the gallery. Handles per-monitor DPI, resizing constraints and the message loop.

public sealed class StandaloneWindow : IDisposable
Inheritance
StandaloneWindow
Implements
Inherited Members

Examples

var host = new UIHost(root, new Size(640, 400), SizingMode.ScaleToFit);
return new StandaloneWindow(host, "My plug-in").Run();

Constructors

StandaloneWindow(UIHost, string)

Creates the window object (the native window is created by Show() or Run()).

public StandaloneWindow(UIHost host, string title)

Parameters

host UIHost
title string

Properties

Host

Hosted UI.

public UIHost Host { get; }

Property Value

UIHost

QuitOnClose

Posts WM_QUIT when the window is destroyed (ends Run()).

public bool QuitOnClose { get; set; }

Property Value

bool

Title

Window caption.

public string Title { get; set; }

Property Value

string

WindowHandle

Native handle (0 before Show()).

public nint WindowHandle { get; }

Property Value

nint

Methods

Close()

Closes the window.

public void Close()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

EnablePerMonitorDpiAwareness()

Opts the process into per-monitor DPI awareness (v2). Call before creating any window; harmless if already set by a manifest.

public static void EnablePerMonitorDpiAwareness()

Run()

Shows the window and runs the message loop until it closes. Returns the exit code.

public int Run()

Returns

int

Show()

Creates and shows the window.

public void Show()

Events

Closed

Raised after the window was destroyed.

public event Action<StandaloneWindow>? Closed

Event Type

Action<StandaloneWindow>

Closing

Raised when the user asks to close the window; set the argument's Cancel to keep it open.

public event Action<StandaloneWindow, CancelEventArgs>? Closing

Event Type

Action<StandaloneWindow, CancelEventArgs>