Browse Source

UndoLimit now uses property properly

pull/6023/head
Deadpikle 5 years ago
parent
commit
4fe29b0f9e
  1. 8
      src/Avalonia.Controls/TextBox.cs

8
src/Avalonia.Controls/TextBox.cs

@ -141,8 +141,8 @@ namespace Avalonia.Controls
public static readonly DirectProperty<TextBox, int> UndoLimitProperty =
AvaloniaProperty.RegisterDirect<TextBox, int>(
nameof(UndoLimit),
o => o._undoRedoHelper.Limit,
(o, v) => o._undoRedoHelper.Limit = v,
o => o.UndoLimit,
(o, v) => o.UndoLimit = v,
unsetValue: -1);
struct UndoRedoState : IEquatable<UndoRedoState>
@ -481,10 +481,10 @@ namespace Avalonia.Controls
public int UndoLimit
{
get { return GetValue(UndoLimitProperty); }
get { return _undoRedoHelper.Limit; }
set
{
SetValue(UndoLimitProperty, value);
_undoRedoHelper.Limit = value;
// from docs at
// https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.textboxbase.isundoenabled:
// "Setting UndoLimit clears the undo queue."

Loading…
Cancel
Save