public interface IDesktopBoundsWindowHost : IDesktopWindowHost, IAsyncDisposable An optional native host that moves and resizes its window in one operation and changes its minimum size while it is open.
Remarks
Runic Desktop finds it by type, like IDesktopWindowStateHost. Report DesktopWindowCapabilities.Bounds and DesktopWindowCapabilities.MinimumSize in IDesktopWindowHost.Capabilities for the operations the window supports; Runic Desktop calls a member only with its flag. With DesktopWindowCapabilities.Bounds, report DesktopWindowState.Bounds in the state in the units IDesktopBoundsWindowHost.SetBoundsAsync takes, and DesktopWindowState.VisibleBounds and DesktopWindowState.IsSnapped where the toolkit knows them.
A host without it, or without a flag, makes DesktopWindow.SetBoundsAsync and DesktopWindow.SetMinimumSizeAsync fail with window-capability-unavailable.
Methods
SetBoundsAsync
ValueTask SetBoundsAsync(DesktopWindowBounds bounds, CancellationToken cancellationToken = default) Moves and resizes the window in one native operation, so it is never shown moved but not resized.
Parameters
boundsThe frame in the units of
DesktopWindowState.Bounds, checked by Runic Desktop: a positive size, andDesktopWindowBounds.XandDesktopWindowBounds.Yboth set or bothnull, which keeps the top-left corner where it is.cancellationTokenCancels the queued native work.
Returns
A task that completes when the window has been asked to take the bounds.
Remarks
Fail with InvalidOperationException while the window is maximized, full-screen or minimized, and with a DesktopException coded window-position-unavailable for a position the toolkit cannot set.
SetMinimumSizeAsync
ValueTask SetMinimumSizeAsync(int width, int height, CancellationToken cancellationToken = default) Changes the window's minimum size, growing the window when it is smaller.
Parameters
widthThe minimum width in the units of
DesktopWindowHostOptions.MinimumWidth, or zero for none.heightThe minimum height in the units of
DesktopWindowHostOptions.MinimumHeight, or zero for none.cancellationTokenCancels the queued native work.
Returns
A task that completes when the toolkit enforces the minimum.