Skip to main content

NullUndoManager Class

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents
public class NullUndoManager

Inheritance: object -> NullUndoManager

Implements: IUndoHistory, IUndoManager, IDisposable

Remarks​

Prefer a real Avalonia.Controls.Documents.Undo.UndoManager with Avalonia.Controls.Documents.Undo.UndoManager.IsEnabled set to , or no manager at all. Both record nothing and neither needs a second implementation of the contract to exist.

Methods​

NameDescription
BeginUndoUnitNo summary available.
ClearDiscards the whole history.
DisposeNo summary available.
RecordRecords a unit directly onto the undo stack.
RedoRedoes the most recently undone unit and returns it.
UndoUndoes the most recent unit and returns it.

BeginUndoUnit Method​

public Avalonia.Controls.Documents.Undo.IUndoScope BeginUndoUnit(string description, Nullable<Avalonia.Controls.Documents.Undo.SelectionSnapshot> selectionBefore)

Parameters​

description string

selectionBefore Nullable<Avalonia.Controls.Documents.Undo.SelectionSnapshot>

Returns​

Avalonia.Controls.Documents.Undo.IUndoScope

Clear Method​

Discards the whole history.

public void Clear()

Dispose Method​

public void Dispose()

Record Method​

Records a unit directly onto the undo stack.

public void Record(Avalonia.Controls.Documents.Undo.IUndoUnit unit)

Parameters​

unit Avalonia.Controls.Documents.Undo.IUndoUnit

The unit to record. It has to satisfy an internal contract, so a unit built outside this assembly is rejected. Group edits with Avalonia.Controls.Documents.Undo.IUndoManager.BeginUndoUnit(string,Nullable{Avalonia.Controls.Documents.Undo.SelectionSnapshot}) instead.

Redo Method​

Redoes the most recently undone unit and returns it.

public Avalonia.Controls.Documents.Undo.IUndoUnit Redo()

Returns​

Avalonia.Controls.Documents.Undo.IUndoUnit

Undo Method​

Undoes the most recent unit and returns it.

public Avalonia.Controls.Documents.Undo.IUndoUnit Undo()

Returns​

Avalonia.Controls.Documents.Undo.IUndoUnit

Properties​

NameDescription
CanRedoGets whether there is anything to redo.
CanUndoGets whether there is anything to undo.
InstanceThe single instance.
IsEnabledGets or sets whether edits are recorded.
RedoUnitsThe units that can be redone, most recent last.
UndoLimitGets or sets how many units the history keeps.
UndoUnitsThe units that can be undone, most recent last.

CanRedo Property​

Gets whether there is anything to redo.

public bool CanRedo { get; set; }

CanUndo Property​

Gets whether there is anything to undo.

public bool CanUndo { get; set; }

Instance Property​

The single instance.

public Avalonia.Controls.Documents.Undo.NullUndoManager Instance { get; set; }

IsEnabled Property​

Gets or sets whether edits are recorded.

public bool IsEnabled { get; set; }

RedoUnits Property​

The units that can be redone, most recent last.

public System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Documents.Undo.IUndoUnit> RedoUnits { get; set; }

UndoLimit Property​

Gets or sets how many units the history keeps.

public int UndoLimit { get; set; }

UndoUnits Property​

The units that can be undone, most recent last.

public System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Documents.Undo.IUndoUnit> UndoUnits { get; set; }

Events​

NameDescription
StateChangedRaised when the ability to undo or redo changes.

StateChanged Event​

Raised when the ability to undo or redo changes.

public event EventHandler StateChanged