From abfa846e9dcc3af8daf96b3fe5adedb480e44a2b Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 20 Aug 2020 19:39:21 +0100 Subject: [PATCH] add comments and move public method above private and protected. --- src/Avalonia.Controls/TextBox.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index d1d75d512e..2506fd0624 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -369,6 +369,14 @@ namespace Avalonia.Controls get { return _newLine; } set { SetAndRaise(NewLineProperty, ref _newLine, value); } } + + /// + /// Clears the current selection, maintaining the + /// + public void ClearSelection() + { + SelectionStart = SelectionEnd = CaretIndex; + } protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { @@ -407,11 +415,6 @@ namespace Avalonia.Controls _presenter?.ShowCaret(); } - public void ClearSelection() - { - SelectionStart = SelectionEnd = CaretIndex; - } - protected override void OnLostFocus(RoutedEventArgs e) { base.OnLostFocus(e);