Class Application
Base implementation of IApplication based-on
Inheritance
Implements
Namespace: CarinaStudio
Assembly: CarinaStudio.AppBase.Application.Avalonia.dll
Syntax
public abstract class Application : Avalonia.Application, IAvaloniaApplication, IApplication, INotifyPropertyChanged, IThreadDependent, ISynchronizable
Constructors
| Improve this Doc View SourceApplication()
Initialize new Application instance.
Declaration
protected Application()
Properties
| Improve this Doc View SourceAssembly
Get Assembly of application.
Declaration
public virtual Assembly Assembly { get; }
Property Value
Type | Description |
---|---|
Assembly |
CultureInfo
Get Culture
Declaration
public abstract CultureInfo CultureInfo { get; }
Property Value
Type | Description |
---|---|
Culture |
Current
Get Application instance for current process.
Declaration
public static Application Current { get; }
Property Value
Type | Description |
---|---|
Application |
CurrentOrNull
Get Application instance for current process, or null if Application is not ready yet.
Declaration
public static Application CurrentOrNull { get; }
Property Value
Type | Description |
---|---|
Application |
IsShutdownStarted
Whether application shutdown has been started or not.
Declaration
public abstract bool IsShutdownStarted { get; }
Property Value
Type | Description |
---|---|
System. |
LoggerFactory
Declaration
public abstract ILoggerFactory LoggerFactory { get; }
Property Value
Type | Description |
---|---|
ILogger |
PersistentState
Get default
Declaration
public abstract ISettings PersistentState { get; }
Property Value
Type | Description |
---|---|
ISettings |
RootPrivateDirectoryPath
Path to root of private directory which is suitable to be accessed by this application.
Declaration
public virtual string RootPrivateDirectoryPath { get; }
Property Value
Type | Description |
---|---|
System. |
Settings
Get default application level user settings.
Declaration
public abstract ISettings Settings { get; }
Property Value
Type | Description |
---|---|
ISettings |
SynchronizationContext
Get Dispatcher
Declaration
public DispatcherSynchronizationContext SynchronizationContext { get; }
Property Value
Type | Description |
---|---|
Dispatcher |
Methods
| Improve this Doc View SourceGetObservableString(String)
Declaration
public abstract IObservable<string?> GetObservableString(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key |
Returns
Type | Description |
---|---|
IObservable<System. |
GetResourceObservable(Object, Nullable<Func<Nullable<Object>, Nullable<Object>>>)
Get observable resource with given key.
Declaration
public IObservable<object?> GetResourceObservable(object key, Func<object?, object?>? converter = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Key. |
System. |
converter | Value converter. |
Returns
Type | Description |
---|---|
IObservable<System. |
Observable value of resource. |
Remarks
This should be a thread-safe method.
GetString(String, Nullable<String>)
Get string from resources according to given key and current settings or system language.
Declaration
public abstract string? GetString(string key, string? defaultValue = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Key of string to get. |
System. |
defaultValue | Default string. |
Returns
Type | Description |
---|---|
System. |
String. |
OnFrameworkInitializationCompleted()
Called when Avalonia framework initialized.
Declaration
public override void OnFrameworkInitializationCompleted()
OnPropertyChanged(String)
Raise
Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System. |
propertyName | Name of changed property. |
OnStringUpdated(EventArgs)
Raise Strings
Declaration
protected virtual void OnStringUpdated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Event |
e | Event data. |
TryFindResource(Object, Nullable<ThemeVariant>, out Nullable<Object>)
Try finding resource within the object.
Declaration
public bool TryFindResource(object key, ThemeVariant? theme, out object? value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The resource key. |
System. |
theme | Theme used to select theme dictionary. |
System. |
value | The value with given key. |
Returns
Type | Description |
---|---|
System. |
True if the resource found. |
Remarks
This should be a thread-safe method.
Events
| Improve this Doc View SourceStringsUpdated
Raised when string resources updated.
Declaration
public event EventHandler? StringsUpdated
Event Type
Type | Description |
---|---|
System. |