NullUndoManager Class
Definition
An Avalonia.Controls.Documents.Undo.IUndoManager that records nothing.
public class NullUndoManager
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
| Name | Description |
|---|---|
| BeginUndoUnit | No summary available. |
| Clear | Discards the whole history. |
| Dispose | No summary available. |
| Record | Records a unit directly onto the undo stack. |
| Redo | Redoes the most recently undone unit and returns it. |
| Undo | Undoes 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
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
Undo Method
Undoes the most recent unit and returns it.
public Avalonia.Controls.Documents.Undo.IUndoUnit Undo()
Returns
Properties
| Name | Description |
|---|---|
| CanRedo | Gets whether there is anything to redo. |
| CanUndo | Gets whether there is anything to undo. |
| Instance | The single instance. |
| IsEnabled | Gets or sets whether edits are recorded. |
| RedoUnits | The units that can be redone, most recent last. |
| UndoLimit | Gets or sets how many units the history keeps. |
| UndoUnits | The 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
| Name | Description |
|---|---|
| StateChanged | Raised when the ability to undo or redo changes. |
StateChanged Event
Raised when the ability to undo or redo changes.
public event EventHandler StateChanged