Class Application
- Namespace
- CarinaStudio
- Assembly
- CarinaStudio.AppBase.Application.Avalonia.dll
Base implementation of IApplication based-on Avalonia.Application.
public abstract class Application : Application, IDataContextProvider, IGlobalDataTemplates, IDataTemplateHost, IGlobalStyles, IStyleHost, IThemeVariantHost, IResourceHost, IResourceNode, IApplicationPlatformEvents, IAvaloniaApplication, IApplication, INotifyPropertyChanged, IThreadDependent, ISynchronizable
- Inheritance
-
AvaloniaObjectApplicationApplication
- Implements
-
IDataContextProviderIGlobalDataTemplatesIDataTemplateHostIGlobalStylesIStyleHostIThemeVariantHostIResourceHostIResourceNodeIApplicationPlatformEvents
- Inherited Members
-
Application.DataContextPropertyApplication.ActualThemeVariantPropertyApplication.RequestedThemeVariantPropertyApplication.NamePropertyApplication.Initialize()Application.RegisterServices()Application.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)Application.DataContextApplication.RequestedThemeVariantApplication.ActualThemeVariantApplication.DataTemplatesApplication.ResourcesApplication.StylesApplication.ApplicationLifetimeApplication.PlatformSettingsApplication.NameApplication.ResourcesChangedApplication.UrlsOpenedApplication.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.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.PropertyChanged
- Extension Methods
Constructors
Application()
Initialize new Application instance.
protected Application()
Properties
Assembly
Get Assembly of application.
public virtual Assembly Assembly { get; }
Property Value
CultureInfo
Get CultureInfo currently used by application.
public abstract CultureInfo CultureInfo { get; }
Property Value
Current
Get Application instance for current process.
public static Application Current { get; }
Property Value
CurrentOrNull
Get Application instance for current process, or null if Application is not ready yet.
public static Application? CurrentOrNull { get; }
Property Value
IsShutdownStarted
Whether application shutdown has been started or not.
public abstract bool IsShutdownStarted { get; }
Property Value
LoggerFactory
ILoggerFactory to create logger.
public abstract ILoggerFactory LoggerFactory { get; }
Property Value
PersistentState
Get default ISettings to keep persistent state of application.
public abstract ISettings PersistentState { get; }
Property Value
RootPrivateDirectoryPath
Path to root of private directory which is suitable to be accessed by this application.
public virtual string RootPrivateDirectoryPath { get; }
Property Value
Settings
Get default application level user settings.
public abstract ISettings Settings { get; }
Property Value
SynchronizationContext
Get DispatcherSynchronizationContext of UI thread.
public DispatcherSynchronizationContext SynchronizationContext { get; }
Property Value
Methods
GetObservableString(string)
Get string from resources according to given key as IObservable<T>.
public abstract IObservable<string?> GetObservableString(string key)
Parameters
key
stringKey of string to get.
Returns
GetResourceObservable(object, Func<object?, object?>?)
Get observable resource with given key.
public IObservable<object?> GetResourceObservable(object key, Func<object?, object?>? converter = null)
Parameters
Returns
- IObservable<object>
Observable value of resource.
Remarks
This should be a thread-safe method.
GetString(string, string?)
Get string from resources according to given key and current settings or system language.
public abstract string? GetString(string key, string? defaultValue = null)
Parameters
Returns
- string
String.
OnFrameworkInitializationCompleted()
Called when Avalonia framework initialized.
public override void OnFrameworkInitializationCompleted()
OnPropertyChanged(string)
Raise PropertyChanged event.
protected virtual void OnPropertyChanged(string propertyName)
Parameters
propertyName
stringName of changed property.
OnStringUpdated(EventArgs)
Raise StringsUpdated event.
protected virtual void OnStringUpdated(EventArgs e)
Parameters
e
EventArgsEvent data.
TryFindResource(object, ThemeVariant?, out object?)
Try finding resource within the object.
public bool TryFindResource(object key, ThemeVariant? theme, out object? value)
Parameters
key
objectThe resource key.
theme
ThemeVariantTheme used to select theme dictionary.
value
objectThe value with given key.
Returns
- bool
True if the resource found.
Remarks
This should be a thread-safe method.
Events
StringsUpdated
Raised when string resources updated.
public event EventHandler? StringsUpdated