Class AppBuilder
- Namespace
- Avalonia
- Assembly
- Avalonia.Controls.dll
Initializes platform-specific services for an Application.
public sealed class AppBuilder
- Inheritance
-
AppBuilder
- Inherited Members
- Extension Methods
Properties
AfterPlatformServicesSetupCallback
public Action<AppBuilder> AfterPlatformServicesSetupCallback { get; }
Property Value
AfterSetupCallback
Gets a method to call after the Application is setup.
public Action<AppBuilder> AfterSetupCallback { get; }
Property Value
ApplicationType
Gets the type of the Instance (even if it's not created yet)
public Type? ApplicationType { get; }
Property Value
Instance
Gets the Application instance being initialized.
public Application? Instance { get; }
Property Value
LifetimeOverride
Gets a method to override a lifetime factory.
[Obsolete("This property has no effect", true)]
public Func<Type, IApplicationLifetime?>? LifetimeOverride { get; }
Property Value
RenderingSubsystemInitializer
Gets or sets a method to call the initialize the windowing subsystem.
public Action? RenderingSubsystemInitializer { get; }
Property Value
RenderingSubsystemName
Gets the name of the currently selected rendering subsystem.
public string? RenderingSubsystemName { get; }
Property Value
RuntimePlatformServicesInitializer
Gets or sets a method to call the initialize the runtime platform services (e. g. AssetLoader)
public Action? RuntimePlatformServicesInitializer { get; }
Property Value
RuntimePlatformServicesName
Gets the name of the currently selected windowing subsystem.
public string? RuntimePlatformServicesName { get; }
Property Value
WindowingSubsystemInitializer
Gets or sets a method to call the initialize the windowing subsystem.
public Action? WindowingSubsystemInitializer { get; }
Property Value
WindowingSubsystemName
Gets the name of the currently selected windowing subsystem.
public string? WindowingSubsystemName { get; }
Property Value
Methods
AfterApplicationSetup(Action<AppBuilder>)
[PrivateApi]
public AppBuilder AfterApplicationSetup(Action<AppBuilder> callback)
Parameters
callback
Action<AppBuilder>
Returns
AfterPlatformServicesSetup(Action<AppBuilder>)
public AppBuilder AfterPlatformServicesSetup(Action<AppBuilder> callback)
Parameters
callback
Action<AppBuilder>
Returns
AfterSetup(Action<AppBuilder>)
public AppBuilder AfterSetup(Action<AppBuilder> callback)
Parameters
callback
Action<AppBuilder>
Returns
ConfigureFonts(Action<FontManager>)
Registers an action that is executed with the current font manager.
public AppBuilder ConfigureFonts(Action<FontManager> action)
Parameters
action
Action<FontManager>The action.
Returns
- AppBuilder
An AppBuilder instance.
Configure<TApp>()
Begin configuring an Application.
public static AppBuilder Configure<TApp>() where TApp : Application, new()
Returns
- AppBuilder
An AppBuilder instance.
Type Parameters
TApp
The subclass of Application to configure.
Configure<TApp>(Func<TApp>)
Begin configuring an Application.
public static AppBuilder Configure<TApp>(Func<TApp> appFactory) where TApp : Application
Parameters
appFactory
Func<TApp>Factory function for
TApp
.
Returns
- AppBuilder
An AppBuilder instance.
Type Parameters
TApp
The subclass of Application to configure.
Remarks
appFactory
is useful for passing of dependencies to TApp
.
SetupWithLifetime(IApplicationLifetime)
Sets up the platform-specific services for the application and initialized it with a particular lifetime, but does not run it.
public AppBuilder SetupWithLifetime(IApplicationLifetime lifetime)
Parameters
lifetime
IApplicationLifetime
Returns
SetupWithoutStarting()
Sets up the platform-specific services for the application, but does not run it.
public AppBuilder SetupWithoutStarting()
Returns
Start(AppMainDelegate, string[])
public void Start(AppBuilder.AppMainDelegate main, string[] args)
Parameters
main
AppBuilder.AppMainDelegateargs
string[]
UseRenderingSubsystem(Action, string)
Specifies a rendering subsystem to use.
public AppBuilder UseRenderingSubsystem(Action initializer, string name = "")
Parameters
initializer
ActionThe method to call to initialize the rendering subsystem.
name
stringThe name of the rendering subsystem.
Returns
- AppBuilder
An AppBuilder instance.
UseRuntimePlatformSubsystem(Action, string)
Specifies a runtime platform subsystem to use.
public AppBuilder UseRuntimePlatformSubsystem(Action initializer, string name = "")
Parameters
initializer
ActionThe method to call to initialize the runtime platform subsystem.
name
stringThe name of the runtime platform subsystem.
Returns
- AppBuilder
An AppBuilder instance.
UseStandardRuntimePlatformSubsystem()
Specifies a standard runtime platform subsystem to use.
public AppBuilder UseStandardRuntimePlatformSubsystem()
Returns
- AppBuilder
An AppBuilder instance.
UseWindowingSubsystem(Action, string)
Specifies a windowing subsystem to use.
public AppBuilder UseWindowingSubsystem(Action initializer, string name = "")
Parameters
initializer
ActionThe method to call to initialize the windowing subsystem.
name
stringThe name of the windowing subsystem.
Returns
- AppBuilder
An AppBuilder instance.
With<T>(Func<T>)
Configures platform-specific options
public AppBuilder With<T>(Func<T> options)
Parameters
options
Func<T>
Returns
Type Parameters
T
With<T>(T)
Configures platform-specific options
public AppBuilder With<T>(T options)
Parameters
options
T
Returns
Type Parameters
T