IDesktopColorSchemeWindowHost interface

Namespace Runic.Desktop in Runic.Desktop 0.23.0

public interface IDesktopColorSchemeWindowHost : IDesktopWindowHost, IAsyncDisposable

Inherits or implements IDesktopWindowHost, IAsyncDisposable.

An optional native host that changes its window's light or dark appearance while it is open.

Remarks

Runic Desktop finds it by type and calls IDesktopColorSchemeWindowHost.SetColorSchemeAsync after DesktopWindow.SetColorSchemeAsync and DesktopHost.SetColorSchemeAsync. Report DesktopWindowCapabilities.ColorScheme in IDesktopWindowHost.Capabilities. The page's prefers-color-scheme should follow, as it does for DesktopWindowHostOptions.ColorScheme.

Methods

SetColorSchemeAsync

ValueTask SetColorSchemeAsync(DesktopColorScheme colorScheme, CancellationToken cancellationToken = default)

Changes the window's appearance.

Parameters

colorScheme

The scheme to show, already resolved: the window's own, else the application's (DesktopHost.ColorScheme). DesktopColorScheme.NoPreference follows the system.

cancellationToken

Cancels the queued native work.

Returns

A task that completes when the window and its page show the scheme.