diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index a438d7380b..943a73b427 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -275,6 +275,22 @@ namespace Avalonia.Controls } } + public string SelectedText + { + get { return GetSelection(); } + set + { + if (value == null) + { + return; + } + + _undoRedoHelper.Snapshot(); + HandleTextInput(value); + _undoRedoHelper.Snapshot(); + } + } + /// /// Gets or sets the horizontal alignment of the content within the control. ///