Added TrackedProperty for commiting and reverting values

This commit is contained in:
TheXamlGuy
2024-05-23 01:08:24 +01:00
parent f11370830f
commit 246dab4297
2 changed files with 48 additions and 12 deletions
+10
View File
@@ -0,0 +1,10 @@
namespace Toolkit.Foundation;
public class TrackedProperty<T>(T initial,
Action<T> revert,
Func<T> commit)
{
public void Commit() => initial = commit();
public void Revert() => revert(initial);
}