Table of Contents

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
AvaloniaObject
Application
Application
Implements
IDataContextProvider
IGlobalDataTemplates
IDataTemplateHost
IGlobalStyles
IStyleHost
IThemeVariantHost
IResourceHost
IResourceNode
IApplicationPlatformEvents
Inherited Members
Application.DataContextProperty
Application.ActualThemeVariantProperty
Application.RequestedThemeVariantProperty
Application.NameProperty
Application.Initialize()
Application.RegisterServices()
Application.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Application.DataContext
Application.RequestedThemeVariant
Application.ActualThemeVariant
Application.DataTemplates
Application.Resources
Application.Styles
Application.ApplicationLifetime
Application.PlatformSettings
Application.Name
Application.ResourcesChanged
Application.UrlsOpened
Application.ActualThemeVariantChanged
AvaloniaObject.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.InheritanceParent
AvaloniaObject.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

Assembly

CultureInfo

Get CultureInfo currently used by application.

public abstract CultureInfo CultureInfo { get; }

Property Value

CultureInfo

Current

Get Application instance for current process.

public static Application Current { get; }

Property Value

Application

CurrentOrNull

Get Application instance for current process, or null if Application is not ready yet.

public static Application? CurrentOrNull { get; }

Property Value

Application

IsShutdownStarted

Whether application shutdown has been started or not.

public abstract bool IsShutdownStarted { get; }

Property Value

bool

LoggerFactory

ILoggerFactory to create logger.

public abstract ILoggerFactory LoggerFactory { get; }

Property Value

ILoggerFactory

PersistentState

Get default ISettings to keep persistent state of application.

public abstract ISettings PersistentState { get; }

Property Value

ISettings

RootPrivateDirectoryPath

Path to root of private directory which is suitable to be accessed by this application.

public virtual string RootPrivateDirectoryPath { get; }

Property Value

string

Settings

Get default application level user settings.

public abstract ISettings Settings { get; }

Property Value

ISettings

SynchronizationContext

public DispatcherSynchronizationContext SynchronizationContext { get; }

Property Value

DispatcherSynchronizationContext

Methods

GetObservableString(string)

Get string from resources according to given key as IObservable<T>.

public abstract IObservable<string?> GetObservableString(string key)

Parameters

key string

Key of string to get.

Returns

IObservable<string>

IObservable<T>.

GetResourceObservable(object, Func<object?, object?>?)

Get observable resource with given key.

public IObservable<object?> GetResourceObservable(object key, Func<object?, object?>? converter = null)

Parameters

key object

Key.

converter Func<object, object>

Value converter.

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

key string

Key of string to get.

defaultValue string

Default string.

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 string

Name of changed property.

OnStringUpdated(EventArgs)

Raise StringsUpdated event.

protected virtual void OnStringUpdated(EventArgs e)

Parameters

e EventArgs

Event data.

TryFindResource(object, ThemeVariant?, out object?)

Try finding resource within the object.

public bool TryFindResource(object key, ThemeVariant? theme, out object? value)

Parameters

key object

The resource key.

theme ThemeVariant

Theme used to select theme dictionary.

value object

The 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

Event Type

EventHandler