CdCSharp.Pangea 1.0.25

There is a newer version of this package available.
See the version list below for details.
dotnet add package CdCSharp.Pangea --version 1.0.25
                    
NuGet\Install-Package CdCSharp.Pangea -Version 1.0.25
                    
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="CdCSharp.Pangea" Version="1.0.25" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CdCSharp.Pangea" Version="1.0.25" />
                    
Directory.Packages.props
<PackageReference Include="CdCSharp.Pangea" />
                    
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 CdCSharp.Pangea --version 1.0.25
                    
#r "nuget: CdCSharp.Pangea, 1.0.25"
                    
#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 CdCSharp.Pangea@1.0.25
                    
#: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=CdCSharp.Pangea&version=1.0.25
                    
Install as a Cake Addin
#tool nuget:?package=CdCSharp.Pangea&version=1.0.25
                    
Install as a Cake Tool

CdCSharp.Pangea

Modern Avalonia Toolkit with MVVM, automatic property binding, theming, and cross-platform storage.

Requirements

  • .NET 9.0
  • Avalonia 11.3.2+

Installation

dotnet add package CdCSharp.Pangea

Features

Core Architecture

  • Modular feature-based system with automatic discovery
  • Dependency injection integration with Microsoft.Extensions
  • Type registry for automatic window/viewmodel resolution
  • Command factory with error handling

Binding System

  • Source generators for automatic property creation
  • [Binding] attribute on fields generates properties with INotifyPropertyChanged
  • Dependency tracking for computed properties
  • Command invalidation on property changes
  • Collection modification detection

MVVM Infrastructure

  • PangeaViewModelBase with built-in binding support
  • RelayCommand and RelayCommand<T> implementations
  • Navigation services with parameter passing
  • Window management services

Theming Engine

  • Multi-theme support (Light/Dark/Custom)
  • Platform-aware theme detection
  • Runtime theme switching
  • Resource-based theme definitions
  • Source generators for theme resource management

Storage System

  • Cross-platform path providers (Windows/Linux/macOS/Portable)
  • Configurable data storage locations
  • File system abstraction layer
  • Support for portable applications

Localization

  • Resource-based localization system
  • Runtime language switching
  • Binding-aware localization updates

Basic Usage

Application Setup

public partial class App : PangeaApplication
{
    protected override PangeaOptions GetPangeaOptions()
    {
        return new PangeaOptions
        {
            Window = 
            {
                AutoDiscoverMainWindow = true,
                MainWindowType = typeof(MainWindow),
                MainViewModelType = typeof(MainViewModel)
            }
        };
    }
}

// Program.cs
public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .WithInterFont()
        .LogToTrace()
        .UsePangea(); // Enables Pangea framework

ViewModel with Automatic Binding

public partial class MainViewModel : PangeaViewModelBase
{
    [Binding] private string _title = "Hello Pangea";
    [Binding] private int _counter;
    [Binding] private bool _isEnabled = true;
    
    // Source generator creates:
    // public string Title { get => _title; set => SetProperty(ref _title, value); }
    // public int Counter { get => _counter; set => SetProperty(ref _counter, value); }
    // public bool IsEnabled { get => _isEnabled; set => SetProperty(ref _isEnabled, value); }
    
    public RelayCommand IncrementCommand => CreateCommand(Increment);
    
    private void Increment()
    {
        Counter++;
    }
}

Theme Management

public class ThemeViewModel : PangeaViewModelBase
{
    private readonly IThemeService _themeService;
    
    public ThemeViewModel(IThemeService themeService)
    {
        _themeService = themeService;
    }
    
    public RelayCommand SwitchToLightCommand => CreateCommand(() => 
        _themeService.SetThemeVariant(PangeaThemeVariant.Light));
        
    public RelayCommand SwitchToDarkCommand => CreateCommand(() => 
        _themeService.SetThemeVariant(PangeaThemeVariant.Dark));
}

Storage Usage

public class DataService
{
    private readonly IStorageService _storage;
    
    public DataService(IStorageService storage)
    {
        _storage = storage;
    }
    
    public async Task SaveConfigAsync(Config config)
    {
        string path = _storage.GetDataFilePath("config.json");
        await _storage.WriteTextAsync(path, JsonSerializer.Serialize(config));
    }
    
    public async Task<Config?> LoadConfigAsync()
    {
        string path = _storage.GetDataFilePath("config.json");
        if (_storage.FileExists(path))
        {
            string json = await _storage.ReadTextAsync(path);
            return JsonSerializer.Deserialize<Config>(json);
        }
        return null;
    }
}

Configuration

Storage Configuration

services.Configure<StorageOptions>(options =>
{
    options.ApplicationName = "MyApp";
    options.UsePortableMode = false; // Use system directories
    options.CustomDataPath = @"C:\MyAppData"; // Optional custom path
});

DI Configuration

public override void ConfigureServices(IServiceCollection services)
{
    services.Configure<PangeaOptions>(options =>
    {
        options.DI.AutoRegisterViewModels = true;
        options.DI.ViewModelLifetime = ServiceLifetime.Transient;
    });
}

Build From Source

git clone https://github.com/smaicas/CdCSharp.Pangea.git
cd CdCSharp.Pangea
dotnet restore
dotnet build

Architecture

CdCSharp.Pangea/
├── Core/                    # Base abstractions and services
├── Binding/                 # Automatic property binding
├── Binding.CodeGeneration/  # Source generators for binding
├── Theming/                 # Theme management system  
├── Theming.CodeGeneration/  # Source generators for theming
├── Storage/                 # Cross-platform file storage
└── Localization/           # Multi-language support

License

MIT

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.

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.34 148 8/30/2025
1.0.33 155 8/29/2025
1.0.32 175 8/26/2025
1.0.31 194 8/26/2025
1.0.30 193 8/26/2025
1.0.29 146 8/25/2025
1.0.28 195 8/24/2025
1.0.27 195 8/24/2025
1.0.26 194 8/24/2025
1.0.25 191 8/24/2025
1.0.23 195 8/24/2025
1.0.22 54 8/23/2025
1.0.20 54 8/23/2025
1.0.19 57 8/23/2025
1.0.18 52 8/23/2025
1.0.17 55 8/23/2025
1.0.9 126 8/21/2025
1.0.8 125 8/21/2025
1.0.6 126 8/21/2025
1.0.5 123 8/21/2025
1.0.4 124 8/21/2025
1.0.0 119 8/21/2025