public interface IDesktopNativeDispatchWindowHost : 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
actionThe native work to run.
cancellationTokenPrevents 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.