From 8b9aace2e451cae83b7cd7b8fdad7a1afad85dd0 Mon Sep 17 00:00:00 2001 From: achal7 Date: Fri, 13 Apr 2018 17:56:25 +0530 Subject: [PATCH] 1) changed UpdateLastState to call UpdateLastState(TState) so that its the only one that has last update control 2) Clear function clean up the states, however currentNode by definition is depends upon one of the state value, hence made that also null, since there is nothing now to link --- src/Avalonia.Controls/Utils/UndoRedoHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Utils/UndoRedoHelper.cs b/src/Avalonia.Controls/Utils/UndoRedoHelper.cs index c76555e554..17cf681f15 100644 --- a/src/Avalonia.Controls/Utils/UndoRedoHelper.cs +++ b/src/Avalonia.Controls/Utils/UndoRedoHelper.cs @@ -59,7 +59,7 @@ namespace Avalonia.Controls.Utils public void UpdateLastState() { - _states.Last.Value = _host.UndoRedoState; + UpdateLastState(_host.UndoRedoState); } public void DiscardRedo() @@ -94,6 +94,7 @@ namespace Avalonia.Controls.Utils public void Clear() { _states.Clear(); + _currentNode = null; } bool WeakTimer.IWeakTimerSubscriber.Tick()