AvaloniaSkinManager 1.0.4

dotnet add package AvaloniaSkinManager --version 1.0.4
                    
NuGet\Install-Package AvaloniaSkinManager -Version 1.0.4
                    
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="AvaloniaSkinManager" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AvaloniaSkinManager" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="AvaloniaSkinManager" />
                    
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 AvaloniaSkinManager --version 1.0.4
                    
#r "nuget: AvaloniaSkinManager, 1.0.4"
                    
#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 AvaloniaSkinManager@1.0.4
                    
#: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=AvaloniaSkinManager&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=AvaloniaSkinManager&version=1.0.4
                    
Install as a Cake Tool

AvaloniaThemeManager

A comprehensive theme management library for Avalonia UI applications with multiple built-in themes, dynamic theme switching, and extensive control styling.

NuGet Version NuGet Downloads License: MIT

Features

  • 7 Built-in Themes: Dark, Light, Ocean Blue, Forest Green, Purple Haze, High Contrast, and Cyberpunk
  • Dynamic Theme Switching: Change themes at runtime with smooth transitions
  • Persistent Settings: Automatically saves and restores user theme preferences
  • Comprehensive Styling: Extensive theme support for all major Avalonia controls
  • Quick Switcher Control: Ready-to-use theme switcher component
  • Theme Settings Dialog: Complete settings UI for theme management
  • MVVM Architecture: Reactive and clean separation of concerns
  • Easy Integration: Simple setup with AppBuilder extensions

Installation

Install via NuGet Package Manager:

dotnet add package AvaloniaThemeManager

Or via Package Manager Console:

Install-Package AvaloniaThemeManager

Quick Start

1. Setup in Program.cs

using Avalonia;
using AvaloniaThemeManager.Extensions;

public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .UseThemeManager() // Add this line
        .LogToTrace()
        .UseReactiveUI();

2. Include Styles in App.axaml

<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="YourApp.App">
    <Application.Resources>
            <ResourceDictionary>
                        
            <ResourceInclude Source="avares://AvaloniaThemeManager/Themes/CustomThemes.axaml" />
        </ResourceDictionary>
    <Application.Styles>
        <FluentTheme />
        
        
    </Application.Styles>
</Application>

3. Basic Theme Switching

using AvaloniaThemeManager.Theme;

// Switch to a different theme
SkinManager.Instance.ApplySkin("Dark");
SkinManager.Instance.ApplySkin("Ocean Blue");
SkinManager.Instance.ApplySkin("Cyberpunk");

// Get available themes
var availableThemes = SkinManager.Instance.GetAvailableSkinNames();

// Listen for theme changes
SkinManager.Instance.SkinChanged += (sender, args) =>
{
    Console.WriteLine("Theme changed!");
};

Built-in Themes

Theme Name Description Preview
Dark Professional dark theme with blue accents Dark Theme
Light Clean light theme perfect for bright environments Light Theme
Ocean Blue Deep blue theme inspired by ocean depths Ocean Blue
Forest Green Nature-inspired green theme Forest Green
Purple Haze Rich purple theme with mystical vibes Purple Haze
High Contrast Maximum contrast for accessibility High Contrast
Cyberpunk Futuristic neon theme with hot pink accents Cyberpunk

Usage Examples

Using the Quick Theme Switcher Control

<UserControl xmlns:controls="clr-namespace:AvaloniaThemeManager.Controls;assembly=AvaloniaThemeManager">
    <StackPanel>
        
        <controls:QuickThemeSwitcher />
        
        
        <Button Content="Sample Button" />
        <TextBox Watermark="Sample TextBox" />
    </StackPanel>
</UserControl>

Opening the Theme Settings Dialog

using AvaloniaThemeManager.Views;

private async void OpenThemeSettings()
{
    var dialog = new ThemeSettingsDialog();
    await dialog.ShowDialog(this); // 'this' is your parent window
}

Creating Custom Themes

using AvaloniaThemeManager.Theme;
using Avalonia.Media;

// Create a custom theme
var customTheme = new Skin
{
    Name = "My Custom Theme",
    PrimaryColor = Color.Parse("#FF6B6B"),
    SecondaryColor = Color.Parse("#4ECDC4"),
    AccentColor = Color.Parse("#45B7D1"),
    PrimaryBackground = Color.Parse("#2C3E50"),
    SecondaryBackground = Color.Parse("#34495E"),
    PrimaryTextColor = Color.Parse("#FFFFFF"),
    SecondaryTextColor = Color.Parse("#BDC3C7"),
    BorderColor = Color.Parse("#7F8C8D"),
    ErrorColor = Color.Parse("#E74C3C"),
    WarningColor = Color.Parse("#F39C12"),
    SuccessColor = Color.Parse("#2ECC71")
};

// Register and apply the custom theme
SkinManager.Instance.RegisterSkin("Custom", customTheme);
SkinManager.Instance.ApplySkin("Custom");

Advanced Configuration

// Configure theme manager during startup
public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .UseThemeManager(manager =>
        {
            // Register custom themes
            manager.RegisterSkin("Corporate", corporateTheme);
            
            // Set default theme
            manager.ApplySkin("Dark");
        })
        .LogToTrace()
        .UseReactiveUI();

MVVM Integration

Theme Settings ViewModel

using AvaloniaThemeManager.ViewModels;

public class MainWindowViewModel : ViewModelBase
{
    public ThemeSettingsViewModel ThemeSettings { get; }
    
    public MainWindowViewModel()
    {
        ThemeSettings = new ThemeSettingsViewModel();
    }
}

Data Binding in XAML

<Window xmlns:vm="clr-namespace:AvaloniaThemeManager.ViewModels;assembly=AvaloniaThemeManager">
    <ComboBox ItemsSource="{Binding ThemeSettings.AvailableThemes}"
              SelectedItem="{Binding ThemeSettings.SelectedTheme}">
        <ComboBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal" Spacing="8">
                    <Ellipse Width="12" Height="12" Fill="{Binding PreviewColor}" />
                    <TextBlock Text="{Binding Name}" />
                </StackPanel>
            </DataTemplate>
        </ComboBox.ItemTemplate>
    </ComboBox>
</Window>

Styled Controls

AvaloniaThemeManager provides comprehensive styling for:

  • Buttons (Primary, Secondary, Browse, Toolbar variants)
  • TextBoxes (Standard, Dialog variants)
  • ComboBoxes and ComboBoxItems
  • CheckBoxes with custom styling
  • TabControls and TabItems
  • Borders (Default, Card, Status Bar, Toolbar variants)
  • TextBlocks (Various typography styles)
  • Separators (Horizontal and Vertical)
  • PathIcons with multiple size variants
  • Expanders with animated transitions
  • Windows (Default and Dialog variants)

Persistence

Theme preferences are automatically saved to:

  • Windows: %LocalAppData%/ResumeForge/appsettings.json
  • macOS: ~/Library/Application Support/ResumeForge/appsettings.json
  • Linux: ~/.local/share/ResumeForge/appsettings.json

Requirements

  • .NET 8.0 or higher
  • Avalonia UI 11.3.0 or higher
  • C# 12 language features

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Clone the repository
  2. Open in Visual Studio 2022 or JetBrains Rider
  3. Restore NuGet packages
  4. Build and run the sample application

Adding New Themes

  1. Create a new Skin object with your color scheme
  2. Register it in SkinManager.RegisterDefaultSkins()
  3. Add theme description in GetThemeDescription() method
  4. Test with all styled controls

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

v1.0.0 (2025-01-XX)

  • Initial release
  • 7 built-in themes
  • Comprehensive control styling
  • Dynamic theme switching
  • Settings persistence
  • Quick switcher component
  • Theme settings dialog
  • MVVM architecture

Support

Acknowledgments


Made with ❤️ for the Avalonia UI community

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 157 6/4/2025
1.0.3 153 6/2/2025
1.0.2 149 6/2/2025
1.0.1 119 6/1/2025

Initial release with comprehensive theme management capabilities.