NuExt.Minimal.Mvvm.Desktop is a platform-agnostic base layer for desktop MVVM applications. It combines NuExt.Minimal.Mvvm with NuExt.System and holds the parts that are useful for any UI stack - WPF, Avalonia, WinUI, MAUI - without referencing a single UI framework.
- Deterministic lifecycle -
InitializableBaseprovides an idempotentInitialize/Uninitializepair with matching cleanup. - Change tracking -
ChangeTrackingBaseaddsIChangeTracking,AcceptChanges, and a disposable suspended tracking scope. - Settings - JSON settings objects (
SettingsBase+ISettingsService) and flat key/value settings (KeyValueSetting+KeyValueSettingCollection) stay separate on purpose. - No UI framework - no WPF, Avalonia, WinUI, or MAUI reference, so every desktop stack can share the same layer.
- Allocation-conscious models - change tracking, notifications, and settings conversion avoid hidden allocations in hot paths.
InitializableBase: idempotentInitialize/Uninitializelifecycle on top ofBindableBase.ChangeTrackingBase:IChangeTrackingwithAcceptChangesand suspended tracking.SettingsBase: strongly typed settings object with change tracking, read-only mode, unknown-JSON preservation, and reflection access by property name.ISettingsService: loads and savesSettingsBaseto JSON files.KeyValueSetting: a single named setting stored as a raw string with an explicitType, typed accessors, andGetValue<T>().KeyValueSettingCollection: change-tracked collection ofKeyValueSettingthat raisesSettingChanged.SettingChangedEventArgs: notification payload for a changed setting value.ExpandableBase:IExpandablesupport.JsonObjectStateSerializer: serializes and restores object state as JSON, keeping unrecognized properties.EnvironmentServiceBase: application directories - base, config, app data, working, logs, settings.
The two settings pipelines are intentionally separate.
SettingsBasewithISettingsServicepersists a strongly typed object graph as JSON.KeyValueSettingwithKeyValueSettingCollectionmodels flat key/value rows: each value is a raw string converted on demand usingValueType, which is what a database-backed settings table stores.
- .NET Standard 2.0+, .NET 8/9/10/11, and .NET Framework 4.6.2+
- Works with WPF, Avalonia, WinUI, and MAUI applications
- Does not reference any UI framework
Via NuGet:
dotnet add package NuExt.Minimal.Mvvm.DesktopOr via Visual Studio:
- Go to
Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution.... - Search for
NuExt.Minimal.Mvvm.Desktop. - Click "Install".
- NuExt.System
- NuExt.System.Data
- NuExt.System.Data.SQLite
- NuExt.Minimal.Mvvm
- NuExt.Minimal.Mvvm.SourceGenerator
- NuExt.Minimal.Behaviors.Wpf
- NuExt.Presentation.Wpf
- NuExt.Minimal.Mvvm.Wpf
- NuExt.Minimal.Mvvm.AvalonDock
- NuExt.Minimal.Mvvm.MahApps.Metro
- NuExt.Minimal.Mvvm.Desktop.Persistence
Issues and PRs are welcome. Keep changes minimal and performance-conscious.
MIT. See LICENSE.