XAML Behaviors

August 20, 2026 ยท View on GitHub

CI Release

NuGet NuGet

Xaml Behaviors is a port of Windows UWP version of XAML Behaviors for Avalonia XAML.

XAML Behaviors for Avalonia is an easy-to-use means of adding common and reusable interactivity to your Avalonia applications with minimal code. Avalonia port is available only for managed applications. Use of XAML Behaviors is governed by the MIT License.

In addition to the classic reflection-based behaviors from WPF/UWP, this port adds source generators that create strongly typed actions and triggers. They remove runtime reflection, improve AOT/linker friendliness, and surface diagnostics at compile time.

See the AOT-friendly behaviors docs for examples and guidance.

Animation definitions and composition helpers are also available independently through Xaml.Behaviors.Animations. This package depends on Avalonia only; behavior, action, and trigger adapters in Xaml.Behaviors.Interactions.Custom reuse the same implementation. See the standalone animations guide.

The standalone animations sample demonstrates every feature family in a dedicated tab without referencing the behaviors framework.

Building XAML Behaviors Avalonia

First, clone the repository or download the latest zip.

git clone https://github.com/wieslawsoltes/Xaml.Behaviors.git

Build on Windows using script

Open up a command-prompt and execute the commands:

.\build.ps1

Build on Linux using script

Open up a terminal prompt and execute the commands:

./build.sh

Build on OSX using script

Open up a terminal prompt and execute the commands:

./build.sh

NuGet

Avalonia XamlBehaviors is delivered as a NuGet package.

You can find the packages here NuGet and install the package like this:

Install-Package Xaml.Behaviors

or by using nightly build feed:

  • Add https://www.myget.org/F/xamlbehaviors-nightly/api/v2 to your package sources
  • Alternative nightly build feed https://pkgs.dev.azure.com/wieslawsoltes/GitHub/_packaging/Nightly/nuget/v3/index.json
  • Update your package using XamlBehaviors feed

and install the package like this:

Install-Package Xaml.Behaviors -Pre

Package Sources

Available Packages

PackageNuGetDescription
Xaml.BehaviorsNuGetComplete library of behaviors, actions and triggers for Avalonia applications.
Xaml.Behaviors.AnimationsNuGetReusable Avalonia animations, composition effects, and transition helpers with no behaviors dependency.
Xaml.Behaviors.AvaloniaNuGetMeta package that bundles all Avalonia XAML Behaviors for easy installation.
Xaml.Behaviors.InteractivityNuGetFoundation library providing base classes for actions, triggers and behaviors.
Xaml.Behaviors.InteractionsNuGetCore collection of common triggers and actions for Avalonia.
Xaml.Behaviors.Interactions.CustomNuGetCustom behaviors and actions for common Avalonia controls.
Xaml.Behaviors.Interactions.DragAndDropNuGetBehaviors that enable drag-and-drop support in Avalonia.
Xaml.Behaviors.Interactions.DragAndDrop.DataGridNuGetDataGrid-specific drag-and-drop helpers built on top of the drag-and-drop framework.
Xaml.Behaviors.Interactions.DraggableNuGetDraggable element behaviors for moving controls around.
Xaml.Behaviors.Interactions.EventsNuGetBehaviors responding to Avalonia input and focus events.
Xaml.Behaviors.Interactions.ReactiveUINuGetBehaviors integrating ReactiveUI navigation patterns.
Xaml.Behaviors.Interactions.ResponsiveNuGetBehaviors to assist with responsive and adaptive UI layouts.
Xaml.Behaviors.Interactions.ScriptingNuGetExecute C# scripts at runtime to add dynamic behavior.

Docs

XAML Behaviors for Avalonia documentation.

The logo features a stylized hexagon (representing a behavior/component) with a gradient in Avalonia-like colors (purple/violet) and a white lightning bolt (representing interactivity/triggers) in the center.

Logo

Resources

License

XAML Behaviors is licensed under the MIT license.