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)
public StandaloneWindow(UIHost host, string title)
Parameters
Properties
Host
Hosted UI.
public UIHost Host { get; }
Property Value
QuitOnClose
Posts WM_QUIT when the window is destroyed (ends Run()).
public bool QuitOnClose { get; set; }
Property Value
Title
Window caption.
public string Title { get; set; }
Property Value
WindowHandle
Native handle (0 before Show()).
public nint WindowHandle { get; }
Property Value
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
Show()
Creates and shows the window.
public void Show()
Events
Closed
Raised after the window was destroyed.
public event Action<StandaloneWindow>? Closed
Event Type
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