IDesktopNativeDispatchWindowHost interface

Namespace Runic.Desktop · Runic.Desktop 0.7.0-preview.5

public interface IDesktopNativeDispatchWindowHost : IDesktopWindowHost, IAsyncDisposable

Inherits or implements IDesktopWindowHost, IAsyncDisposable.

An optional native host exposing its owning dispatcher to platform services.

Properties

SupportsNativeDispatch

bool SupportsNativeDispatch { get; }

Gets whether IDesktopNativeDispatchWindowHost.DispatchNativeAsync can run work on the window's owning thread.

Methods

CheckNativeAccess

bool CheckNativeAccess()

Gets whether the caller is executing on the thread that owns the native window.

Returns

true on the owning thread; otherwise false.

DispatchNativeAsync

ValueTask DispatchNativeAsync(Action action, CancellationToken cancellationToken)

Runs action on the thread that owns the native window.

Parameters

action

The native work to run.

cancellationToken

Prevents the work from running if it has not started.

Returns

A task that completes after action has run, with any exception it threw.

Remarks

Cancellation must not interrupt a running callback; the returned task completes when it finishes.