Typical shared startup:
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect();
UsePlatformDetect() on desktop wires:
Skia tuning option exposed by runtime configuration:
SkiaOptions.UseOpacitySaveLayerUseSkia()WithInterFont()UseManagedSystemDialogs()Related extension host types:
AppBuilderExtension (Inter font package extension host)SkiaApplicationExtensions (Skia rendering extension host)Public extension classes you will see in app startup code:
Win32ApplicationExtensionsAvaloniaX11PlatformExtensionsAvaloniaNativePlatformExtensionsBrowserAppBuilderLinuxFramebufferPlatformExtensionsAndroidApplicationExtensionsIOSApplicationExtensionsThese contain entry points like UseWin32(), UseX11(), UseAvaloniaNative(), UseBrowser(), UseAndroid(), and UseiOS().
UseWin32)Entry point:
UseWin32()Options:
Win32PlatformOptions
RenderingModeCompositionModeDpiAwarenessOverlayPopupsShouldRenderOnUIThreadWglProfilesCustomPlatformGraphicsWinUICompositionBackdropCornerRadiusGraphicsAdapterSelectionCallbackRelated enums:
Win32RenderingModeWin32DpiAwarenessWin32CompositionModeGuidance:
RenderingMode,GraphicsAdapterSelectionCallback only when you have measured adapter-specific issues.UseX11)Entry points:
UseX11()InitializeX11Platform(X11PlatformOptions? options = null)Options:
X11PlatformOptions
RenderingModeOverlayPopupsUseDBusMenuUseDBusFilePickerEnableImeEnableInputFocusProxyEnableSessionManagementShouldRenderOnUIThreadGlProfilesGlxRendererBlacklistWmClassEnableMultiTouchUseRetainedFramebufferUseGLibMainLoopExterinalGLibMainLoopExceptionLoggerGuidance:
InitializeX11Platform(...) as advanced bootstrapping path,UseAvaloniaNative)Entry point:
UseAvaloniaNative()Options:
AvaloniaNativePlatformOptions
RenderingModeOverlayPopupsAvaloniaNativeLibraryPathAppSandboxEnabledRelated enum:
AvaloniaNativeRenderingModeAdditional macOS options:
MacOSPlatformOptions
ShowInDockDisableDefaultApplicationMenuItemsDisableNativeMenusDisableSetProcessNameDisableAvaloniaAppDelegateEntry points:
StartBrowserAppAsync(mainDivId, options)SetupBrowserAppAsync(options)UseBrowser()Options (BrowserPlatformOptions):
RenderingModeFrameworkAssetPathResolverRegisterAvaloniaServiceWorkerAvaloniaServiceWorkerScopePreferFileDialogPolyfillPreferManagedThreadDispatcherRelated enum:
BrowserRenderingModeGuidance:
WebGL2, WebGL1, software),Entry point:
UseAndroid()Options:
AndroidPlatformOptions.RenderingModeRelated enum:
AndroidRenderingModeGuidance:
Entry points:
UseiOS()UseiOS(IAvaloniaAppDelegate)Options:
iOSPlatformOptions.RenderingModeRelated enum:
iOSRenderingModeGuidance:
Framebuffer entry points:
StartLinuxFbDev(...)StartLinuxDrm(...)StartLinuxDirect(...)Framebuffer options:
LinuxFramebufferPlatformOptions
FpsShouldRenderOnUIThreadHeadless entry point:
UseHeadless(AvaloniaHeadlessPlatformOptions)Headless options:
UseHeadlessDrawingFrameBufferFormatUse headless for tests, CI rendering checks, and non-windowed automation.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.With(new Win32PlatformOptions
{
RenderingMode = new[]
{
Win32RenderingMode.AngleEgl,
Win32RenderingMode.Software
}
})
.With(new X11PlatformOptions
{
RenderingMode = new[]
{
X11RenderingMode.Glx,
X11RenderingMode.Software
}
});
GlProfiles, GraphicsAdapterSelectionCallback) without reproducer-backed need.Default mode:
Program.cs),XAML-first references:
App.axaml style/resource includesWindow/UserControl definitions in .axamlXAML-first usage example:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MyApp.App">
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://MyApp/Styles/Common.axaml" />
</Application.Styles>
</Application>
Code-only alternative (on request):
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.With(new Win32PlatformOptions
{
RenderingMode = new[]
{
Win32RenderingMode.AngleEgl,
Win32RenderingMode.Software
}
});