NativeAOT-friendly undo/redo for modern .NET editors: source-generated properties, continuous gestures, transactions, and observable collections.
dotnet add package Jewelry.EditingSystem
[Undoable] partial properties record normal edits, Undo, and Redo through the same generated setter path.
CoalescingBatch() reduces a slider, drag, or color-picker gesture to one meaningful Undo step.
Transaction() commits or restores tracked edits as a unit; Batch() groups changes that should remain applied.
Track observable collection changes and preserve CommunityToolkit.Mvvm notifications, validation, commands, and messaging.
using Jewelry.EditingSystem;
using Jewelry.EditingSystem.Annotations;
[EditingHistory(nameof(history))]
public sealed partial class Document(History history)
{
[Undoable]
public partial double X { get; set; }
}
using var history = new History();
var document = new Document(history);
document.X = 100;
history.Undo(); // X == 0