Browse Source

add comments and move public method above private and protected.

pull/4526/head
Dan Walmsley 6 years ago
parent
commit
abfa846e9d
  1. 13
      src/Avalonia.Controls/TextBox.cs

13
src/Avalonia.Controls/TextBox.cs

@ -369,6 +369,14 @@ namespace Avalonia.Controls
get { return _newLine; } get { return _newLine; }
set { SetAndRaise(NewLineProperty, ref _newLine, value); } set { SetAndRaise(NewLineProperty, ref _newLine, value); }
} }
/// <summary>
/// Clears the current selection, maintaining the <see cref="CaretIndex"/>
/// </summary>
public void ClearSelection()
{
SelectionStart = SelectionEnd = CaretIndex;
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e) protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{ {
@ -407,11 +415,6 @@ namespace Avalonia.Controls
_presenter?.ShowCaret(); _presenter?.ShowCaret();
} }
public void ClearSelection()
{
SelectionStart = SelectionEnd = CaretIndex;
}
protected override void OnLostFocus(RoutedEventArgs e) protected override void OnLostFocus(RoutedEventArgs e)
{ {
base.OnLostFocus(e); base.OnLostFocus(e);

Loading…
Cancel
Save