Added TrackedProperty for commiting and reverting values
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user