App Class

graph TD Base0["Application"]-->Type click Base0 "/api/Avalonia/Application" Base1["object"]-->Base0 Interface0["IApplicationLifecycle"]-.->Type click Interface0 "/api/Avalonia.Controls/IApplicationLifecycle" Interface1["IGlobalDataTemplates"]-.->Type click Interface1 "/api/Avalonia.Controls/IGlobalDataTemplates" Interface2["IDataTemplateHost"]-.->Type click Interface2 "/api/Avalonia.Controls.Templates/IDataTemplateHost" Interface3["IGlobalStyles"]-.->Type click Interface3 "/api/Avalonia.Styling/IGlobalStyles" Interface4["IStyleRoot"]-.->Type click Interface4 "/api/Avalonia.Styling/IStyleRoot" Interface5["IStyleHost"]-.->Type click Interface5 "/api/Avalonia.Styling/IStyleHost" Interface6["IResourceNode"]-.->Type click Interface6 "/api/Avalonia.Controls/IResourceNode" Interface7["IResourceProvider"]-.->Type click Interface7 "/api/Avalonia.Controls/IResourceProvider" Type["App"] class Type type-node

Syntax

public class App : Application, IApplicationLifecycle, IGlobalDataTemplates, IDataTemplateHost, 
    IGlobalStyles, IStyleRoot, IStyleHost, IResourceNode, IResourceProvider

Events

Name Type Summary
OnExit EventHandler
Sent when the application is exiting.
Inherited from Application
ResourcesChanged EventHandler<ResourcesChangedEventArgs>
Raised when resources in the provider are changed.
Inherited from Application

Properties

Name Value Summary
Clipboard IClipboard
Gets the application clipboard.
Inherited from Application
Current Application
Gets the current instance of the Application class.
Inherited from Application
static
DataTemplates DataTemplates
Gets or sets the application's global data templates.
Inherited from Application
ExitMode ExitMode
Gets or sets the ExitMode. This property indicates whether the application exits explicitly or implicitly. If ExitMode is set to OnExplicitExit the application is only closes if Exit is called. The default is OnLastWindowClose
Inherited from Application
FocusManager IFocusManager
Gets the application's focus manager.
Inherited from Application
InputManager InputManager
Gets the application's input manager.
Inherited from Application
MainWindow Window
Gets or sets the main window of the application.
Inherited from Application
Resources IResourceDictionary
Gets the application's global resource dictionary.
Inherited from Application
Styles Styles
Gets the application's global styles.
Inherited from Application
Windows WindowCollection
Gets the open windows of the application.
Inherited from Application

Methods

Name Value Summary
CreateSimpleWindow() ContentControl
static
Exit() void
Exits the application
Inherited from Application
Initialize() void
OnExiting(object, EventArgs) void
Called when the application is exiting.
Inherited from Application
RegisterServices() void
Register's the services needed by Avalonia.
Inherited from Application
Run(CancellationToken) void
Runs the application's main loop until the CancellationToken is canceled.
Inherited from Application
Run(ICloseable) void
Runs the application's main loop until the ICloseable is closed.
Inherited from Application
Run(Window) void
Runs the application's main loop until some condition occurs that is specified by ExitMode.
Inherited from Application

Extension Methods

Name Value Summary
FindResource(string) object
Finds the specified resource by searching up the logical tree and then global styles.
GetResourceObservable(string) IObservable<object>
RunWithMainWindow<TWindow>() void
TryFindResource(string, object) bool
Tries to the specified resource by searching up the logical tree and then global styles.