Table of Contents

Interface IWindowHandleUiContext

Namespace
VpnHood.AppLib.Abstractions.UiContexts
Assembly
VpnHood.AppLib.Abstractions.dll

Represents a desktop window as the UI context, with its native handle and its thread: the owner a Windows dialog takes, as the Microsoft Store's own do (IInitializeWithWindow), and the thread it must be opened on.

public interface IWindowHandleUiContext : IUiContext
Inherited Members

Methods

GetWindowHandle()

Gets the window's native handle.

Task<nint> GetWindowHandle()

Returns

Task<nint>

A task whose result is the handle.

Exceptions

InvalidOperationException

The window has no native handle.

RunOnUiThread<T>(Func<T>)

Runs a function on the window's UI thread.

Task<T> RunOnUiThread<T>(Func<T> action)

Parameters

action Func<T>

The function.

Returns

Task<T>

A task whose result is the function's.

Type Parameters

T

The function's result's type.