Atc.XamlToolkit 1.5.44

There is a newer version of this package available.
See the version list below for details.
dotnet add package Atc.XamlToolkit --version 1.5.44
                    
NuGet\Install-Package Atc.XamlToolkit -Version 1.5.44
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Atc.XamlToolkit" Version="1.5.44" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Atc.XamlToolkit" Version="1.5.44" />
                    
Directory.Packages.props
<PackageReference Include="Atc.XamlToolkit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Atc.XamlToolkit --version 1.5.44
                    
#r "nuget: Atc.XamlToolkit, 1.5.44"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Atc.XamlToolkit@1.5.44
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Atc.XamlToolkit&version=1.5.44
                    
Install as a Cake Addin
#tool nuget:?package=Atc.XamlToolkit&version=1.5.44
                    
Install as a Cake Tool

ATC.Net Avalonia and WPF

This is a base libraries for building Avalonia or WPF application with the MVVM design pattern.

🎁 Key Features

🏗️ MVVM Foundation

  • ViewModelBase - Base class with INotifyPropertyChanged
  • MainWindowViewModelBase - Main window lifecycle management
  • ViewModelDialogBase - Dialog-specific ViewModels
  • ObservableObject - Lightweight observable pattern

⚡ Commands

  • RelayCommand / RelayCommand<T> - Synchronous commands with CanExecute support
  • RelayCommandAsync / RelayCommandAsync<T> - Async/await commands for responsive UIs
  • Automatic CanExecute refresh - Commands automatically update UI state
  • Error handling support - Built-in IErrorHandler interface for graceful error management

🔔 Messaging System

Decouple your ViewModels with a powerful messaging infrastructure:

  • Messenger - Central message bus for app-wide communication
  • GenericMessage<T> - Send typed messages between components
  • NotificationMessage - Simple notifications with optional callbacks
  • PropertyChangedMessage<T> - Broadcast property changes across ViewModels

Perfect for scenarios like:

  • Cross-ViewModel communication without direct references
  • Event aggregation patterns
  • Plugin architectures
  • Loosely-coupled component communication
// Send a message
Messenger.Default.Send(new GenericMessage<User>(currentUser));

// Receive a message
Messenger.Default.Register<GenericMessage<User>>(this, msg =>
{
    var user = msg.Content;
    // Handle the user...
});

Learn more: Messaging System Documentation

🎨 Value Converters

Extensive collection of ready-to-use XAML converters for both WPF and Avalonia:

Bool Converters
  • BoolToInverseBoolValueConverter
  • BoolToVisibilityCollapsedValueConverter
  • BoolToVisibilityVisibleValueConverter
  • BoolToWidthValueConverter
  • MultiBoolToBoolValueConverter (AND/OR logic)
  • MultiBoolToVisibilityVisibleValueConverter
String Converters
  • StringNullOrEmptyToBoolValueConverter
  • StringNullOrEmptyToInverseBoolValueConverter
  • StringNullOrEmptyToVisibilityVisibleValueConverter
  • StringNullOrEmptyToVisibilityCollapsedValueConverter
  • ToLowerValueConverter / ToUpperValueConverter

See detailed Value Converters documentation

⚙️ Source Generators

Eliminate boilerplate with powerful code generation:

  • [ObservableProperty] - Auto-generate properties with change notification
  • [RelayCommand] - Auto-generate command properties from methods
  • [DependencyProperty] (WPF) - Auto-generate dependency properties
  • [AttachedProperty] (WPF) - Auto-generate attached properties
  • [RoutedEvent] (WPF) - Auto-generate routed events

Learn more about each generator:

🚀 Performance Optimizations

  • BooleanBoxes - Cached boolean boxing for reduced memory allocations
  • WeakAction/WeakFunc - Memory-leak prevention for event handlers and callbacks
  • PropertyDefaultValueConstants - Shared default values for common property types

🔧 Utilities

  • DesignModeHelper - Detect design-time vs runtime for better designer experience
  • Base Converter Classes - ValueConverterBase and MultiValueConverterBase for creating custom converters
  • Error Handling - IErrorHandler interface for centralized command error management

🚀 Quick Start

Installation

Install via NuGet Package Manager or .NET CLI:

For WPF:

dotnet add package Atc.XamlToolkit.Wpf

For Avalonia:

dotnet add package Atc.XamlToolkit.Avalonia

Basic Usage

// Create a ViewModel with source-generated properties and commands
public partial class MainViewModel : ViewModelBase
{
    [ObservableProperty]
    private string userName;

    [ObservableProperty]
    private bool isLoading;

    [RelayCommand]
    private async Task LoadDataAsync()
    {
        IsLoading = true;
        // Load data...
        IsLoading = false;
    }
}

📖 Read the full Getting Started Guide for a complete walkthrough.

Requirements

NuGet Packages Provided in this Repository

Nuget package Description Dependencies
NuGet Version Base package with ViewModelBase, ObservableObject Atc & Atc.XamlToolkit.SourceGenerators
NuGet Version RelayCommand, MainWindowViewModelBase for Avalonia Atc.XamlToolkit
NuGet Version RelayCommand, MainWindowViewModelBase for WPF Atc.XamlToolkit.SourceGenerators

📚 Documentation

Get Started

Core Concepts

Advanced Topics

Platform-Specific (WPF Only)

Source Generator Examples

Example for ViewModel classes with source generation:

MVVM Source Generation

For more details, see the MVVM section.

🎯 Complete Feature List

Core MVVM Components

Component Description Package
ViewModelBase Base ViewModel with INotifyPropertyChanged Atc.XamlToolkit
MainWindowViewModelBase Main window lifecycle management Atc.XamlToolkit.Wpf/Avalonia
ViewModelDialogBase Dialog-specific ViewModels Atc.XamlToolkit
ObservableObject Lightweight observable pattern Atc.XamlToolkit

Commands

Command Description Async Support
RelayCommand Synchronous command No
RelayCommand<T> Synchronous command with parameter No
RelayCommandAsync Asynchronous command Yes
RelayCommandAsync<T> Asynchronous command with parameter Yes

All commands support:

  • CanExecute with automatic refresh
  • ✅ Error handling via IErrorHandler
  • ✅ Auto-generation via [RelayCommand] attribute

Messaging System

Type Purpose
Messenger Central message bus
GenericMessage<T> Typed message passing
NotificationMessage String-based notifications
NotificationMessageAction Messages with callbacks
NotificationMessageAction<T> Messages with parameterized callbacks
PropertyChangedMessage<T> Property change broadcasts
NotificationMessageWithCallback Generic callback support

Source Generators

Generator Platform Description
[ObservableProperty] WPF, Avalonia Auto-generate observable properties
[RelayCommand] WPF, Avalonia Auto-generate command properties
[DependencyProperty] WPF only Auto-generate dependency properties
[AttachedProperty] WPF only Auto-generate attached properties
[RoutedEvent] WPF only Auto-generate routed events

Value Converters

Bool Converters (WPF & Avalonia):

  • BoolToInverseBoolValueConverter
  • BoolToVisibilityCollapsedValueConverter
  • BoolToVisibilityVisibleValueConverter
  • BoolToWidthValueConverter
  • MultiBoolToBoolValueConverter
  • MultiBoolToVisibilityVisibleValueConverter

String Converters (WPF & Avalonia):

  • StringNullOrEmptyToBoolValueConverter
  • StringNullOrEmptyToInverseBoolValueConverter
  • StringNullOrEmptyToVisibilityVisibleValueConverter
  • StringNullOrEmptyToVisibilityCollapsedValueConverter
  • ToLowerValueConverter
  • ToUpperValueConverter

Performance Optimizations

Optimization Benefit
BooleanBoxes Zero-allocation boolean boxing
WeakAction Memory leak prevention
WeakFunc<T> Memory leak prevention with return values
PropertyDefaultValueConstants Shared default values

Utilities

Utility Purpose
DesignModeHelper Detect design-time vs runtime
ValueConverterBase Base class for custom converters
MultiValueConverterBase Base class for multi-value converters
IErrorHandler Centralized error handling

🌟 Why Choose Atc.XamlToolkit?

  • Modern - Built for .NET 9 with latest C# features
  • Cross-platform - Supports both WPF and Avalonia
  • High Performance - Optimized for minimal allocations
  • Source Generators - Eliminate boilerplate code
  • Well Documented - Comprehensive documentation and examples
  • Battle Tested - Used in production applications
  • Open Source - MIT licensed and community-driven

How to contribute

Contribution Guidelines

Coding Guidelines

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • Atc (>= 2.0.562)

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Atc.XamlToolkit:

Package Downloads
Atc.Wpf.Controls

WPF control library providing atomic UI controls including input controls, pickers, layouts, and progress indicators.

Atc.Wpf.Theming

WPF theming library providing light and dark themes with customizable styles for WPF applications.

Atc.Wpf.Controls.Sample

Reusable WPF controls for building sample and demonstration applications.

Atc.XamlToolkit.Wpf

Atc.XamlToolkit.Wpf is a library for building WPF applications using the MVVM design pattern.

Atc.XamlToolkit.Avalonia

Atc.XamlToolkit.Avalonia is a library for building Avalonia applications using the MVVM design pattern.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.18 143 3/18/2026
3.0.16 112 3/11/2026
3.0.14 110 3/1/2026
3.0.13 112 2/22/2026
3.0.11 101 2/22/2026
3.0.10 123 2/20/2026
3.0.6 260 1/20/2026
3.0.5 124 1/19/2026
3.0.1 179 1/6/2026
1.5.81 249 11/3/2025
1.5.78 232 11/2/2025
1.5.77 240 11/2/2025
1.5.76 198 10/31/2025
1.5.75 216 10/27/2025
1.5.74 189 10/26/2025
1.5.67 203 10/24/2025
1.5.63 218 10/20/2025
1.5.62 224 10/19/2025
1.5.44 239 10/5/2025
1.5.43 223 10/2/2025
Loading failed