book_4_sparkGenerated
code_blocksInput

Description

The Back property in the UndoSystem class represents a stack that stores undo entries. This stack is used to keep track of actions that can be undone, allowing the system to revert changes in the reverse order they were made.

Usage

Use the Back property to access the stack of undo entries. This stack is manipulated internally by the UndoSystem methods such as Undo and Insert. Direct manipulation of this stack is generally not recommended unless you are implementing custom undo logic.

Example

// Example of using the UndoSystem
UndoSystem undoSystem = new UndoSystem();

// Insert an undoable action
undoSystem.Insert(
    "Change Color",
    () => { /* Code to undo the color change */ },
    () => { /* Code to redo the color change */ }
);

// Perform an undo
if (undoSystem.Undo())
{
    // Successfully undone
}

// Access the Back stack (not recommended for direct manipulation)
var backStack = undoSystem.Back;