MVVM_Utility 1.0.4
dotnet add package MVVM_Utility --version 1.0.4
NuGet\Install-Package MVVM_Utility -Version 1.0.4
<PackageReference Include="MVVM_Utility" Version="1.0.4" />
<PackageVersion Include="MVVM_Utility" Version="1.0.4" />
<PackageReference Include="MVVM_Utility" />
paket add MVVM_Utility --version 1.0.4
#r "nuget: MVVM_Utility, 1.0.4"
#:package MVVM_Utility@1.0.4
#addin nuget:?package=MVVM_Utility&version=1.0.4
#tool nuget:?package=MVVM_Utility&version=1.0.4
Mvvm.TrackableViewModel
Mvvm.TrackableViewModel is a lightweight utility library that simplifies MVVM development by providing deep cloning, edit tracking, and change detection for parent-child view models.
Ideal for WPF, WinForms, and Blazor applications that require editing and rollback support in nested view model hierarchies.
✨ Features
- ✅ Deep cloning with
System.Text.JsonorNewtonsoft.Json - ✅ Built-in support for
IEditableObject(BeginEdit,CancelEdit,EndEdit) - ✅ Implements
IChangeTrackingfor automatic change detection - ✅ Tracks and propagates change state across nested view models
- ✅ Seamlessly integrates with UI data binding
- ✅ Multi-targeting: .NET Framework 4.6.2+, .NET 5–9
📦 Installation
Use the .NET CLI:
dotnet add package Mvvm.TrackableViewModel
Or via NuGet Package Manager:
Install-Package Mvvm.TrackableViewModel
🧪 Example Usage
public class PersonViewModel : ParentBaseViewModel<PersonViewModel>
{
private string _name;
public string Name
{
get => _name;
set => UpdateObservable(ref _name, value);
}
private int _age;
public int Age
{
get => _age;
set => UpdateObservable(ref _age, value);
}
public PersonViewModel(string name, int age)
{
Name = name;
Age = age;
}
}
// Usage
var person = new PersonViewModel("Alice", 30);
person.BeginEdit();
person.Name = "Bob"; // This will trigger change tracking
if (person.IsChanged)
{
person.CancelEdit(); // Reverts changes
// or
person.EndEdit(); // Accepts changes and exits edit mode
}
🧠 How it Works
BeginEdit()makes a deep clone of the current view model.CancelEdit()reverts all properties back to the cloned state.EndEdit()clears the backup and marks the model as clean.IsChangedgets updated automatically whenever any property changes.- Changes in child view models or collections are automatically tracked.
📂 Supported Frameworks
- .NET 5.0
- .NET 6.0
- .NET 7.0
- .NET 8.0
- .NET 9.0
- .NET Framework 4.6.2 and 4.8
🔒 License
© 2025 Abdou Djalilou Ali. All rights reserved.
Licensed under the MIT License.
🙌 Contributing
Feel free to open issues or submit pull requests to improve functionality or documentation!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 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. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
-
.NETFramework 4.6.2
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.8
- Newtonsoft.Json (>= 13.0.3)
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.