public void RedoInternal(bool IncludeSelectionOperation = false) { if (redoStack.Count == 0) { return; } PostFilter redoFilter; do { redoFilter = redoStack.Pop(); undoStack.Push(redoFilter); redoFilter.Apply(); } while ((!IncludeSelectionOperation && redoFilter is SelectionOperation) && redoStack.Count != 0); if (!(redoFilter is EditingDeactivatedOperation || redoFilter is SelectionOperation || redoFilter is SetColorOperation)) { ClearCanvas(false); RecreateCanvasViewModel(); UpdateUIElements(); DisplaySettingsTool.SliceImage(); } else { UpdateUIElements(); } SelectedTool.OnRedo(); }