Class VpnHoodAvaloniaAppBase
- Namespace
- VpnHood.AppUi.Hosting.Avalonia
- Assembly
- VpnHood.AppUi.Hosting.Avalonia.dll
Represents the Avalonia application a VpnHood UI derives from: one view, whatever hosts it.
public abstract class VpnHoodAvaloniaAppBase : Application, INotifyPropertyChanged, IDataContextProvider, IGlobalDataTemplates, IDataTemplateHost, IGlobalStyles, IStyleHost, IThemeVariantHost, IResourceHost, IResourceNode, IOptionalFeatureProvider
- Inheritance
-
AvaloniaObjectApplicationVpnHoodAvaloniaAppBase
- Implements
-
IDataContextProviderIGlobalDataTemplatesIDataTemplateHostIGlobalStylesIStyleHostIThemeVariantHostIResourceHostIResourceNodeIOptionalFeatureProvider
- Inherited Members
-
Application.DataContextPropertyApplication.ActualThemeVariantPropertyApplication.RequestedThemeVariantPropertyApplication.NamePropertyApplication.Initialize()Application.RegisterServices()Application.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)Application.DataContextApplication.RequestedThemeVariantApplication.ActualThemeVariantApplication.CurrentApplication.DataTemplatesApplication.ResourcesApplication.StylesApplication.ApplicationLifetimeApplication.PlatformSettingsApplication.NameApplication.ResourcesChangedApplication.ActualThemeVariantChangedAvaloniaObject.CheckAccess()AvaloniaObject.VerifyAccess()AvaloniaObject.ClearValue(AvaloniaProperty)AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)AvaloniaObject.ClearValue<T>(StyledProperty<T>)AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetHashCode()AvaloniaObject.GetValue(AvaloniaProperty)AvaloniaObject.GetValue<T>(StyledProperty<T>)AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)AvaloniaObject.IsAnimating(AvaloniaProperty)AvaloniaObject.IsSet(AvaloniaProperty)AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)AvaloniaObject.Bind(AvaloniaProperty, BindingBase)AvaloniaObject.CoerceValue(AvaloniaProperty)AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)AvaloniaObject.InheritanceParentAvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.DispatcherAvaloniaObject.PropertyChanged
Remarks
A single-view host, as Android, tvOS or a browser, gets it as the main view; a desktop host gets it in a window that cannot be resized or maximized, in the shape the UI states (WindowFit), fitted to its screen. The head gives the UI the app's API before this runs, and configures it before the view is made; the views read nothing else.
Properties
ChromeColor
Gets the colour of the system's chrome around the UI, as a desktop window's title bar or Android's system bars: the window background its theme names; or null where the UI's content names none, and the host chooses the chrome's colour.
public VhColor? ChromeColor { get; }
Property Value
WindowFit
Gets the shape a desktop window takes for this UI: its layout's, which only its design knows.
public abstract DesktopWindowFitOptions WindowFit { get; }
Property Value
Methods
CreateMainView()
Creates the UI's main view, once the head has configured the UI.
protected abstract Control CreateMainView()
Returns
- Control
The view.
ImportAccessKey(string)
Imports an access key the system opened the app with, as the chosen server, and says so, or that it could not read the key, in the UI's own words.
public abstract Task ImportAccessKey(string accessKey)
Parameters
accessKeystringThe access key, as a desktop launch read it from its file.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
It is called on the UI thread, once the view is made.
ImportAccessKeyFile(IStorageFile)
Imports an access key's file the system opened the app with, as iOS hands it over, as ImportAccessKey(string) does.
public abstract Task ImportAccessKeyFile(IStorageFile file)
Parameters
fileIStorageFileThe file.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
It is called on the UI thread, once the view is made.
OnFrameworkInitializationCompleted()
public override void OnFrameworkInitializationCompleted()
Remarks
It gives the host's lifetime the UI's view, as that lifetime takes one; Avalonia's designer, which makes the UI with no app, gets none.
Exceptions
- InvalidOperationException
The UI has the app's API but has not been configured, and the host's lifetime takes its view at once, as a desktop's or a single view's does.
QuickLaunch()
Connects as the UI's Connect button does, for a Quick Launch, as the Windows Store edition's own entry in Start, unless the app is connected or on its way.
public abstract Task QuickLaunch()
Returns
- Task
A task that represents the asynchronous operation.
Remarks
It is called on the UI thread, once the view is made.
ReloadMainView()
Makes a new view in the desktop window, for what the views read only as they are made; a view in any other host stays as it is.
public void ReloadMainView()
Exceptions
- InvalidOperationException
The head has not configured the UI.