Class AvaloniaDesktopUi<TUi>
Provides the Avalonia UI as a desktop head names it: the UI in AvaloniaDesktopHost's window, against whatever app the head's host hands over, or one message in its place where there is none.
public class AvaloniaDesktopUi<TUi> : IDesktopUi where TUi : Application, IAvaloniaUi, new()
Type Parameters
TUiThe UI's application.
- Inheritance
-
AvaloniaDesktopUi<TUi>
- Implements
- Inherited Members
Methods
BringToFront(CancellationToken)
Asks for the window to show, as the tray's Open does.
public Task BringToFront(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenUnused: the call only queues the request.
Returns
- Task
A task that is already complete.
Remarks
The request goes to the UI thread, or waits for the run's start; the task does not wait for it, and the token is not read.
ImportAccessKey(string, CancellationToken)
Has the UI import an access key.
public Task ImportAccessKey(string accessKey, CancellationToken cancellationToken)
Parameters
accessKeystringThe access key.
cancellationTokenCancellationTokenUnused: the call only queues the request.
Returns
- Task
A task that is already complete.
Remarks
The request goes to the UI thread, or waits for the run's start; the task does not wait for it, and the token is not read.
QuickLaunch(CancellationToken)
Has the UI connect, as its Connect button does.
public Task QuickLaunch(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenUnused: the call only queues the request.
Returns
- Task
A task that is already complete.
Remarks
The request goes to the UI thread, or waits for the run's start; the task does not wait for it, and the token is not read.
Run(DesktopUiParams, CancellationToken)
Runs the UI's window until its run ends.
public void Run(DesktopUiParams uiParams, CancellationToken cancellationToken)
Parameters
uiParamsDesktopUiParamsWhat the window runs against, and how.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Remarks
A token canceled before the call returns at once, and one canceled later ends the run. An access key or a Quick Launch the parameters carry goes to the UI as the run starts.
Exceptions
- InvalidOperationException
The parameters name no UI content store, or the UI made no main window or is not a VpnHoodAvaloniaAppBase.
- OperationCanceledException
cancellationTokenwas canceled while the run started.
RunMessage(DesktopUiMessageParams, CancellationToken)
Runs a window with one message in the UI's place, until it is closed.
public void RunMessage(DesktopUiMessageParams messageParams, CancellationToken cancellationToken)
Parameters
messageParamsDesktopUiMessageParamsThe message.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Remarks
A token canceled before the call returns at once, and one canceled once the window runs ends it. Where the UI's content loads, a run only administrators may use gets the UI's own words, and the Close button the UI's word, in the device's language where the UI has it and else in English; otherwise the message is the host's text, with an English Close.