Summary
Encapsulates a Avalonia application.
- Namespace
- Avalonia
- Interfaces
-
- IAvaloniaObjectDebug
- I
Notify Property Changed - IValueSink
- IDataContextProvider
- IAvaloniaObject
- IGlobalDataTemplates
- IDataTemplateHost
- IGlobalStyles
- IStyleHost
- IResourceHost
- IResourceNode
- I
Application Platform Events
- Base Types
-
- object
- AvaloniaObject
graph BT
Type-->Base0["AvaloniaObject"]
click Base0 "/api/Avalonia/AvaloniaObject"
Base0-->Base1["object"]
Type-.->Interface0["IAvaloniaObjectDebug"]
click Interface0 "/api/Avalonia.Diagnostics/IAvaloniaObjectDebug"
Type-.->Interface1["INotifyPropertyChanged"]
Type-.->Interface2["IValueSink"]
Type-.->Interface3["IDataContextProvider"]
click Interface3 "/api/Avalonia/IDataContextProvider"
Type-.->Interface4["IAvaloniaObject"]
click Interface4 "/api/Avalonia/IAvaloniaObject"
Type-.->Interface5["IGlobalDataTemplates"]
click Interface5 "/api/Avalonia.Controls/IGlobalDataTemplates"
Type-.->Interface6["IDataTemplateHost"]
click Interface6 "/api/Avalonia.Controls.Templates/IDataTemplateHost"
Type-.->Interface7["IGlobalStyles"]
click Interface7 "/api/Avalonia.Styling/IGlobalStyles"
Type-.->Interface8["IStyleHost"]
click Interface8 "/api/Avalonia.Styling/IStyleHost"
Type-.->Interface9["IResourceHost"]
click Interface9 "/api/Avalonia.Controls/IResourceHost"
Type-.->Interface10["IResourceNode"]
click Interface10 "/api/Avalonia.Controls/IResourceNode"
Type-.->Interface11["IApplicationPlatformEvents"]
click Interface11 "/api/Avalonia.Platform/IApplicationPlatformEvents"
Type["Application"]
class Type type-node
Syntax
public class Application : AvaloniaObject, IAvaloniaObjectDebug, INotifyPropertyChanged,
IValueSink, IDataContextProvider, IAvaloniaObject, IGlobalDataTemplates, IDataTemplateHost,
IGlobalStyles, IStyleHost, IResourceHost, IResourceNode, IApplicationPlatformEvents
Remarks
The
Application
class encapsulates Avalonia application-specific
functionality, including:
- A global set of DataTemplates
.
- A global set of Styles
.
- A FocusManager
.
- An InputManager
.
- Registers services needed by the rest of Avalonia in the RegisterServices()
method.
- Tracks the lifetime of the application.
Constructors
Name | Summary |
---|---|
Application |
Creates an instance of the Application class.
|
Events
Name | Type | Summary |
---|---|---|
PropertyChanged | EventHandler |
Raised when a
AvaloniaProperty value changes on this object.
Inherited from AvaloniaObject
|
ResourcesChanged | EventHandler |
Raised when the resources change on the element or an ancestor of the element.
|
UrlsOpened | EventHandler |
Fields
Name | Constant Value | Summary |
---|---|---|
DataContextProperty |
Defines the
DataContext property.
static
|
|
NameProperty |
Defines Name property
static
|
Properties
Name | Value | Summary |
---|---|---|
ApplicationLifetime | IApplicationLifetime |
Application lifetime, use it for things like setting the main window and exiting the app from code
Currently supported lifetimes are:
-
IClassicDesktopStyleApplicationLifetime
- ISingleViewApplicationLifetime
- IControlledApplicationLifetime
|
Clipboard | IClipboard |
Gets the application clipboard.
|
Current | Application |
Gets the current instance of the
Application class.
static
|
DataContext | object |
Gets or sets the Applications's data context.
|
DataTemplates | DataTemplates |
Gets or sets the application's global data templates.
|
FocusManager | IFocusManager |
Gets the application's focus manager.
|
InheritanceParent | IAvaloniaObject |
Gets or sets the parent object that inherited
AvaloniaProperty values
are inherited from.
Inherited from AvaloniaObject
|
InputManager | InputManager |
Gets the application's input manager.
|
Name | string |
Application name to be used for various platform-specific purposes
|
Resources | IResourceDictionary |
Gets the application's global resource dictionary.
|
Styles | Styles |
Gets the application's global styles.
|
this[ |
object |
Gets or sets the value of a
AvaloniaProperty .
Inherited from AvaloniaObject
|
this[ |
IBinding |
Gets or sets a binding for a
AvaloniaProperty .
Inherited from AvaloniaObject
|
Methods
Extension Methods
Name | Value | Summary |
---|---|---|
Bind |
IDisposable |
Binds a
AvaloniaProperty to an observable.
|
Bind |
IDisposable |
Binds a
AvaloniaProperty to an observable.
|
FindResource |
object? |
Finds the specified resource by searching up the logical tree and then global styles.
|
GetBindingObservable |
IObservable |
Gets an observable for a
AvaloniaProperty .
|
GetBindingObservable |
IObservable |
Gets an observable for a
AvaloniaProperty .
|
GetBindingSubject |
ISubject |
Gets a subject for a
AvaloniaProperty .
|
GetBindingSubject |
ISubject |
Gets a subject for a
AvaloniaProperty .
|
GetDiagnostic |
Avalonia |
Gets a diagnostic for a
AvaloniaProperty on a AvaloniaObject .
|
GetObservable |
IObservable |
Gets an observable for a
AvaloniaProperty .
|
GetObservable |
IObservable |
Gets an observable for a
AvaloniaProperty .
|
Get |
IObservable |
Gets an observable that listens for property changed events for an
AvaloniaProperty .
|
Get |
IObservable |
|
GetSubject |
ISubject |
Gets a subject for a
AvaloniaProperty .
|
GetSubject |
ISubject |
Gets a subject for a
AvaloniaProperty .
|
Run |
void | |
Run |
void |
On desktop-style platforms runs the application's main loop with custom CancellationToken
without setting a lifetime.
|
Run |
void |
On desktop-style platforms runs the application's main loop until closable is closed
|
Run |
void |
On desktop-style platforms runs the application's main loop until main window is closed
|
RunWithMainWindow |
void | |
TryFindResource |
bool |
Tries to the specified resource by searching up the logical tree and then global styles.
|