Class AppWebViewPageHost
- Namespace
- VpnHood.AppUi.Hosting.WebView
- Assembly
- VpnHood.AppUi.Hosting.WebView.dll
Provides the app's own web host as the page's server, where the app runs in the web view's process.
public sealed class AppWebViewPageHost : IWebViewPageHost
- Inheritance
-
AppWebViewPageHost
- Implements
- Inherited Members
Constructors
AppWebViewPageHost(IAppWebHost)
Provides the app's own web host as the page's server, where the app runs in the web view's process.
public AppWebViewPageHost(IAppWebHost webHost)
Parameters
webHostIAppWebHostThe app's web host.
Methods
EnsureStarted(CancellationToken)
Gets the address to load: a server the platform owns is started, or checked, by the time it returns; a desktop's is the address the service last handed over.
public Task<Uri> EnsureStarted(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Remarks
A later call is the caller's own sign that the server is unreachable, which may cost the server a real connect check.
Exceptions
- InvalidOperationException
The platform's own server could not bind.
- ObjectDisposedException
The platform's own server was disposed.
- OperationCanceledException
cancellationTokenwas canceled.
Events
Restarted
Occurs when the server is bound again under a loaded page, maybe at another address, so what the page loaded may be half fetched; it may be raised on any thread.
public event EventHandler? Restarted