This map focuses on public APIs that matter directly when building applications (not internal rendering/runtime internals).
AppBuilder (src/Avalonia.Controls/AppBuilder.cs)Primary composition root:
AppBuilder.Configure<TApp>()AppBuilder.Configure<TApp>(Func<TApp>)UseWindowingSubsystem(Action, string)UseRenderingSubsystem(Action, string)UseRuntimePlatformSubsystem(Action, string)UseStandardRuntimePlatformSubsystem()With<T>(T options) / With<T>(Func<T>)ConfigureFonts(Action<FontManager>)SetupWithoutStarting()SetupWithLifetime(IApplicationLifetime)Start(AppMainDelegate, string[] args)Use:
BuildAvaloniaApp().BuildAvaloniaApp() deterministic and side-effect-light.With<T> for platform option objects instead of static mutable state.Avoid:
Configure(Type) patterns outside test/design contexts.Application (src/Avalonia.Controls/Application.cs)Core extension points:
Initialize()RegisterServices()OnFrameworkInitializationCompleted()Global state and resources:
ApplicationLifetimeResourcesStylesDataTemplatesTryGetResource(object, ThemeVariant?, out object?)RequestedThemeVariant, ActualThemeVariantUse:
Initialize().OnFrameworkInitializationCompleted() based on lifetime interface.src/Avalonia.Controls/ApplicationLifetimes/*.cs)IClassicDesktopStyleApplicationLifetime
MainWindow, Windows, ShutdownMode, TryShutdown(...), ShutdownRequestedIControlledApplicationLifetime
Startup, Exit, Shutdown(...)ISingleViewApplicationLifetime
MainViewIActivatableLifetime (feature API)
Activated, Deactivated, TryLeaveBackground(), TryEnterBackground()Desktop helpers:
SetupWithClassicDesktopLifetime(...)StartWithClassicDesktopLifetime(...)Use:
MainWindow.MainView.Application.Current?.TryGetFeature<IActivatableLifetime>().AvaloniaXamlLoader (src/Markup/Avalonia.Markup.Xaml/AvaloniaXamlLoader.cs):
Load(object)Load(IServiceProvider?, object)Load(Uri, Uri?)Load(IServiceProvider?, Uri, Uri?)AvaloniaRuntimeXamlLoader (src/Markup/Avalonia.Markup.Xaml.Loader/AvaloniaRuntimeXamlLoader.cs):
Load(string ...)Load(Stream ...)Load(RuntimeXamlLoaderDocument ...)Use:
InitializeComponent.AOT/trimming notes:
AvaloniaXamlLoader.Load(...) and runtime loaders are annotated for trim risk.Compiled path (preferred):
CompiledBindingCompiledBindingExtensionCompiledBindingPath / CompiledBindingPathBuilderReflection path (fallback):
ReflectionBindingReflectionBindingExtensionMarkup Binding (Avalonia.Markup.Data.Binding) inherits reflection bindingCore binding controls:
BindingModeBindingPriorityUpdateSourceTriggerMultiBindingBindingOperations.DoNothingConverter APIs:
IValueConverterIMultiValueConverterFuncValueConverter<TIn, TOut>FuncValueConverter<TIn, TParam, TOut>FuncMultiValueConverter<TIn, TOut>BoolConvertersStringConvertersObjectConvertersCompiled path builder capabilities:
Property(...)Method(...)Command(...)Self()Ancestor(Type, int)VisualAncestor(Type, int)ElementName(INameScope, string)TemplatedParent()StreamTask<T>()StreamObservable<T>()Use:
x:DataType and use {CompiledBinding ...}.{ReflectionBinding ...}) when unavoidable.AvaloniaProperty / AvaloniaProperty<T>:
Register<TOwner, TValue>(...)RegisterAttached<...>(...)RegisterDirect<TOwner, TValue>(...)AvaloniaObject:
GetValue(...)SetValue(...)SetCurrentValue(...)ClearValue(...)Bind(AvaloniaProperty, IBinding)Bind(AvaloniaProperty, IObservable<object?>, BindingPriority)Use:
StyledProperty for styleable/templateable values.DirectProperty for CLR-backed/readonly-like patterns.SetCurrentValue to preserve existing binding while updating value.AvaloniaObjectExtensions:
GetObservable(...)GetBindingObservable(...)GetPropertyChangedObservable(...)Bind(... IObservable<T> ...)ToBinding()Use:
IObservable<T> and convert with ToBinding().Dispatcher (src/Avalonia.Base/Threading):
Dispatcher.UIThreadInvoke(...)InvokeAsync(...)Post(...)MainLoop(...)BeginInvokeShutdown(...)InvokeShutdown()Use:
Dispatcher.UIThread.Post for fire-and-forget UI notification.InvokeAsync when awaiting UI completion.Core view types:
TopLevelWindowUserControlTemplatedControlControlWindow highlights:
Show() / Show(owner) / ShowDialog<TResult>(owner)Close() / Close(object?)SizeToContent, CanResize, WindowState, Title, Icon, SystemDecorations, WindowStartupLocationTopLevel highlights:
StorageProvider, Clipboard, Screens, InsetsManager, LauncherRequestedThemeVariant / ActualThemeVariantTemplate/data template APIs:
DataTemplateTreeDataTemplateFuncDataTemplateDataTemplatesMenu surface APIs:
MenuBase, Menu, MenuItemContextMenuMenuFlyout, MenuFlyoutPresenterNativeMenu, NativeMenuItem, NativeMenuItemSeparator, NativeMenuBarNativeMenu.SetMenu(...), NativeMenu.GetMenu(...), NativeMenu.GetIsNativeMenuExported(...)Tray and notification APIs:
TrayIcon, TrayIconsTrayIcon.SetIcons(...), TrayIcon.GetIcons(...)TrayIcon.Icon, TrayIcon.ToolTipText, TrayIcon.IsVisible, TrayIcon.MenuMacOSProperties.IsTemplateIconINotification, Notification, NotificationTypeINotificationManager, IManagedNotificationManagerWindowNotificationManager, NotificationPositionScrolling, text editing, and gesture APIs:
ScrollViewer (Offset, Extent, Viewport, ScrollBarMaximum, ScrollChanged)ScrollViewer attached options (HorizontalScrollBarVisibility, VerticalScrollBarVisibility, AllowAutoHide, IsScrollChainingEnabled, IsScrollInertiaEnabled, IsDeferredScrollingEnabled)ScrollViewer snap/anchor surface (HorizontalSnapPointsType, VerticalSnapPointsType, HorizontalSnapPointsAlignment, VerticalSnapPointsAlignment, RegisterAnchorCandidate, UnregisterAnchorCandidate)TextBox (Text, CaretIndex, SelectionStart, SelectionEnd, SelectedText, AcceptsReturn, TextWrapping, IsReadOnly)TextBox clipboard/edit commands (Cut, Copy, Paste, Undo, Redo, SelectAll, ClearSelection, Clear, ScrollToLine)TextBox command state (CanCut, CanCopy, CanPaste, CanUndo, CanRedo, IsUndoEnabled, UndoLimit)Gestures routed events (Tapped, DoubleTapped, RightTapped, Holding, Pinch, PullGesture, ScrollGesture)TextInputOptions attached properties (ContentType, ReturnKeyType, Multiline, AutoCapitalization, IsSensitive, ShowSuggestions)Automation and attached behavior APIs:
AutomationProperties (Name, AutomationId, HelpText, LabeledBy, LiveSetting, AccessibilityView, IsOffscreenBehavior)ToolTip attached APIs (Tip, IsOpen, Placement, ShowDelay, BetweenShowDelay, ShowOnDisabled, ServiceEnabled)RelativePanel attached layout APIs (Above, Below, LeftOf, RightOf, Align*With*)Important behavior:
DataTemplates collection expects typed templates (DataType) for robust matching in shared/global scenarios.Key APIs:
StyleStylesControlThemeSelectors (typed selector builder in C#)ThemeVariant (Default, Light, Dark)ThemeVariantScopeResourceDictionary (MergedDictionaries, ThemeDictionaries, TryGetResource)XAML include APIs:
StyleIncludeResourceIncludeMergeResourceIncludeMedia primitives:
ColorsBrushesFormattedTextUse:
new Style(x => x.OfType<Button>())) for trim-safe code paths when you need runtime selector building.ThemeDictionaries to isolate per-theme values instead of ad-hoc runtime checks.Input/command APIs:
ICommandSourceKeyGestureKeyBindingHotkeyManagerRouted event APIs:
RoutedEventRoutedEvent<TEventArgs>RoutedEventArgsInteractive.AddHandler(...)Interactive.RemoveHandler(...)Interactive.RaiseEvent(...)Use:
Desktop and shared:
UsePlatformDetect()UseSkia()WithInterFont()UseManagedSystemDialogs()Platform-specific entry points:
UseWin32(), Win32PlatformOptionsUseX11(), X11PlatformOptionsUseAvaloniaNative(), AvaloniaNativePlatformOptions, MacOSPlatformOptionsUseAndroid(), AndroidPlatformOptionsUseiOS(), iOSPlatformOptionsUseBrowser(), StartBrowserAppAsync(...), SetupBrowserAppAsync(...), BrowserPlatformOptionsStartLinuxFbDev(...), StartLinuxDrm(...), StartLinuxDirect(...), LinuxFramebufferPlatformOptionsUseHeadless(...), AvaloniaHeadlessPlatformOptionsAdvanced graphics/interop surfaces (specialized):
IPlatformGraphics, IPlatformGraphicsContext, IPlatformGraphicsReadyStateFeature (unstable contracts)IGlContext, GlInterface, GlVersion, IGlPlatformSurface, IGlPlatformSurfaceRenderTargetIVulkanPlatformGraphicsContext, IVulkanDevice, IVulkanRenderTarget, VulkanOptionsDrmOutputOptions, FbdevOutput, DrmCard, DrmResourcesUse:
MSBuild properties (package/build files):
EnableAvaloniaXamlCompilationAvaloniaUseCompiledBindingsByDefaultAvaloniaXamlVerboseExceptionsAvaloniaXamlCreateSourceInfoAvaloniaXamlIlVerifyIlIsAotCompatible (project-level/consumer context)Item groups:
AvaloniaXamlAvaloniaResourceSource generator knobs (Avalonia.Generators.props):
AvaloniaNameGeneratorBehaviorAvaloniaNameGeneratorDefaultFieldModifierAvaloniaNameGeneratorFilterByPathAvaloniaNameGeneratorFilterByNamespaceAvaloniaNameGeneratorViewFileNamingStrategyUse:
x:DataType by default.BuildAvaloniaApp() and view assignment in OnFrameworkInitializationCompleted().Dispatcher.UIThread.With<TOptions>().Default guidance for this skill:
XAML-first references:
Application resources/styles and x:DataType compiled bindingsDataTemplate/ControlTheme declarations in .axamlXAML-first usage example:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:MyApp.ViewModels"
xmlns:views="using:MyApp.Views"
x:Class="MyApp.App">
<Application.Styles>
<FluentTheme />
</Application.Styles>
<Application.DataTemplates>
<DataTemplate x:DataType="vm:MainViewModel">
<views:MainView />
</DataTemplate>
</Application.DataTemplates>
</Application>
Code-only usage example (on request):
using Avalonia;
using Avalonia.Controls;
using Avalonia.Themes.Fluent;
public static class CodeOnlyBootstrap
{
public static void ConfigureApp(Application app)
{
app.Styles.Add(new FluentTheme());
var window = new Window
{
Width = 640,
Height = 360,
DataContext = new MainWindowViewModel(),
Content = new TextBlock
{
Margin = new Thickness(16),
Text = "Hello Avalonia"
}
};
window.Show();
}
}