IDesktopPlacementWindowHost interface

Namespace Runic.Desktop in Runic.Desktop 0.23.0

public interface IDesktopPlacementWindowHost : IDesktopWindowHost, IAsyncDisposable

Inherits or implements IDesktopWindowHost, IAsyncDisposable.

An optional native host that enters full screen and places its window on a chosen monitor.

Remarks

Runic Desktop finds it by type, like IDesktopWindowStateHost. Report DesktopWindowCapabilities.FullScreen and DesktopWindowCapabilities.MonitorPlacement in IDesktopWindowHost.Capabilities for the operations the window supports; Runic Desktop calls a member only with its flag. When opening, apply DesktopWindowHostOptions.MonitorId and a DesktopWindowPlacement.FullScreen placement, and report DesktopWindowState.IsFullScreen, DesktopWindowState.MonitorId and DesktopWindowPlacement.FullScreen in the state. Monitor identifiers are those of IDesktopWindowHostFactory.Monitors.

It covers the monitor and full screen only. Maximize, restore and a saved placement (IDesktopShowStateWindowHost.SetPlacementAsync) are on IDesktopShowStateWindowHost.

Methods

MoveToMonitorAsync

ValueTask MoveToMonitorAsync(string monitorId, CancellationToken cancellationToken = default)

Moves the window to a monitor, centered on its work area and shrunk to fit it.

Parameters

monitorId

The DesktopMonitor.Id of a connected monitor.

cancellationToken

Cancels the queued native work.

Returns

A task that completes when the window has moved; it fails with ArgumentException when no connected monitor has this identifier.

SetFullScreenAsync

ValueTask SetFullScreenAsync(bool fullScreen, CancellationToken cancellationToken = default)

Enters or leaves full screen; does nothing when the window already is or is not full-screen.

Parameters

fullScreen

true to enter full screen; false to leave it.

cancellationToken

Cancels the queued native work.

Returns

A task that completes when the window has been asked to change.