CdCSharp.Pangea.Core
1.0.28
See the version list below for details.
dotnet add package CdCSharp.Pangea.Core --version 1.0.28
NuGet\Install-Package CdCSharp.Pangea.Core -Version 1.0.28
<PackageReference Include="CdCSharp.Pangea.Core" Version="1.0.28" />
<PackageVersion Include="CdCSharp.Pangea.Core" Version="1.0.28" />
<PackageReference Include="CdCSharp.Pangea.Core" />
paket add CdCSharp.Pangea.Core --version 1.0.28
#r "nuget: CdCSharp.Pangea.Core, 1.0.28"
#:package CdCSharp.Pangea.Core@1.0.28
#addin nuget:?package=CdCSharp.Pangea.Core&version=1.0.28
#tool nuget:?package=CdCSharp.Pangea.Core&version=1.0.28
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 withINotifyPropertyChanged
- Dependency tracking for computed properties
- Command invalidation on property changes
- Collection modification detection
MVVM Infrastructure
PangeaViewModelBase
with built-in binding supportRelayCommand
andRelayCommand<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 | Versions 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. |
-
net9.0
- Microsoft.CodeAnalysis.Common (>= 4.8.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.8.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Options (>= 9.0.8)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CdCSharp.Pangea.Core:
Package | Downloads |
---|---|
CdCSharp.Pangea
Modern Avalonia ToolKit with MVVM, Binding, Theming and Storage features |
|
CdCSharp.Pangea.Binding
Binding feature for CdCSharp.Pangea - Auto-generates properties from fields with [Binding] attribute |
|
CdCSharp.Pangea.Theming
Theming feature for CdCSharp.Pangea - Dynamic theme switching with Simple UI |
|
CdCSharp.Pangea.Storage
Storage feature for CdCSharp.Pangea - Cross-platform file and data storage |
|
CdCSharp.Pangea.Localization
Localization feature for CdCSharp.Pangea - Multi-language support with resource management |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.34 | 159 | 8/30/2025 |
1.0.33 | 162 | 8/29/2025 |
1.0.32 | 184 | 8/26/2025 |
1.0.31 | 205 | 8/26/2025 |
1.0.30 | 202 | 8/26/2025 |
1.0.29 | 156 | 8/25/2025 |
1.0.28 | 202 | 8/24/2025 |
1.0.27 | 203 | 8/24/2025 |
1.0.26 | 203 | 8/24/2025 |
1.0.25 | 202 | 8/24/2025 |
1.0.23 | 203 | 8/24/2025 |
1.0.22 | 64 | 8/23/2025 |
1.0.20 | 65 | 8/23/2025 |
1.0.19 | 67 | 8/23/2025 |
1.0.18 | 62 | 8/23/2025 |
1.0.17 | 65 | 8/23/2025 |
1.0.9 | 126 | 8/21/2025 |
1.0.6 | 123 | 8/21/2025 |
1.0.5 | 126 | 8/21/2025 |
1.0.4 | 124 | 8/21/2025 |
1.0.0 | 125 | 8/21/2025 |