How wieslawsoltes/xaml.behaviors works
XAML Behaviors is a reusable-interactivity library for Avalonia applications. The principal workflow is that an attached behavior or trigger responds to a UI lifecycle or input event and invokes an action; the interactivity foundation supplies attachment and event-registration support. Other major capabilities include drag-and-drop, standalone animations and their behavior adapters, generated strongly typed triggers/actions, and specialized interaction packages. The excerpts show the behavior/action foundation and parts of drag-and-drop; links for other documented capabilities are limited to README evidence.
Main entry points: Composition Animation definitions · Triggers Event triggers · ManagedDragDropService.cs Managed drag service · StyledElementBehavior.cs Behavior attachment
Components 20
Interactivity foundation
- Behavior attachment
src/Xaml.Behaviors.Interactivity/StyledElement/StyledElementBehavior.cs - Action execution
src/Xaml.Behaviors.Interactivity/AvaloniaObject/Action.cs - Event registration
src/Xaml.Behaviors.Interactivity/Events/AddEventHandlerRegistry.cs
UI interactions
- Event triggers
src/Xaml.Behaviors.Interactions.Custom/InputElement/Triggers - Control behaviors
src/Xaml.Behaviors.Interactions.Custom - Common actions
src/Xaml.Behaviors.Interactions - Command behaviors
src/Xaml.Behaviors.Interactions.Custom/ExecuteCommand/Core/ExecuteCommandBehaviorBase.cs - Adaptive layouts
src/Xaml.Behaviors.Interactions.Responsive - ReactiveUI navigation
src/Xaml.Behaviors.Interactions.ReactiveUI - Runtime scripting
src/Xaml.Behaviors.Interactions.Scripting
Drag and drop
- Drag behaviors
src/Xaml.Behaviors.Interactions.DragAndDrop/ContextDragBehaviorBase.cs - Drag context
src/Xaml.Behaviors.Interactions.DragAndDrop/DragDropContextStore.cs - Managed drag service
src/Xaml.Behaviors.Interactions.DragAndDrop/ManagedDragDrop/ManagedDragDropService.cs - Drag preview
src/Xaml.Behaviors.Interactions.DragAndDrop/ManagedDragDrop/DragPreviewService.cs - Drop handlers
src/Xaml.Behaviors.Interactions.DragAndDrop/DropHandlerBase.cs
Animation
- Animation definitions
src/Xaml.Behaviors.Animations/Composition - Animation runner
src/Xaml.Behaviors.Animations/Animations/AnimationRunner.cs - Animation behaviors
src/Xaml.Behaviors.Interactions.Custom/Animations
Extensions
- Source generators
src/Xaml.Behaviors.SourceGenerators
Other components
- Avalonia UI
Connections 20
- Avalonia UI → Behavior attachment: hosts behaviors
README.md - Behavior attachment → Action execution: supports invocation
- Event registration → Event triggers: registers events
- Avalonia UI → Event triggers: raises events
- Event triggers → Action execution: invokes actions
README.md - Avalonia UI → Control behaviors: hosts behaviors
README.md - Avalonia UI → Common actions: hosts actions
README.md - Avalonia UI → Command behaviors: hosts behaviors
README.md - Avalonia UI → Adaptive layouts: hosts behaviors
README.md - Avalonia UI → ReactiveUI navigation: hosts navigation
README.md - Avalonia UI → Runtime scripting: hosts scripts
README.md - Drag behaviors → Drag context: stores payload
src/Xaml.Behaviors.Interactions.DragAndDrop/ContextDragBehaviorBase.cs - Managed drag service → Drag context: stores payload
src/Xaml.Behaviors.Interactions.DragAndDrop/ManagedDragDrop/ManagedDragDropService.cs - Managed drag service → Drag preview: updates preview
- Avalonia UI → Drag behaviors: enables drag-drop
README.md - Avalonia UI → Drop handlers: accepts drops
README.md - Avalonia UI → Animation definitions: renders animations
README.md - Animation definitions → Animation runner: runs definitions
- Animation definitions → Animation behaviors: adapts animations
README.md - Avalonia UI → Source generators: generates behaviors
README.md