diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml
index 8dc947c298..256212eaf1 100644
--- a/samples/ControlCatalog/Pages/TextBoxPage.xaml
+++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml
@@ -2,22 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ControlCatalog.Pages.TextBoxPage">
-
-
-
-
TextBox
A control into which the user can input text
@@ -36,6 +20,7 @@
@@ -54,8 +39,8 @@
-
-
+
+
resm fonts
diff --git a/src/Avalonia.Controls/Presenters/TextPresenter.cs b/src/Avalonia.Controls/Presenters/TextPresenter.cs
index ef33ac19f6..1cd7e11564 100644
--- a/src/Avalonia.Controls/Presenters/TextPresenter.cs
+++ b/src/Avalonia.Controls/Presenters/TextPresenter.cs
@@ -14,8 +14,8 @@ namespace Avalonia.Controls.Presenters
o => o.CaretIndex,
(o, v) => o.CaretIndex = v);
- public static readonly StyledProperty ShowPasswordCharProperty =
- AvaloniaProperty.Register(nameof(ShowPasswordChar), true);
+ public static readonly StyledProperty ShowPasswordTextProperty =
+ AvaloniaProperty.Register(nameof(ShowPasswordText));
public static readonly StyledProperty PasswordCharProperty =
AvaloniaProperty.Register(nameof(PasswordChar));
@@ -78,7 +78,7 @@ namespace Avalonia.Controls.Presenters
static TextPresenter()
{
AffectsRender(SelectionBrushProperty);
- AffectsMeasure(TextProperty, PasswordCharProperty, ShowPasswordCharProperty,
+ AffectsMeasure(TextProperty, PasswordCharProperty, ShowPasswordTextProperty,
TextAlignmentProperty, TextWrappingProperty, TextBlock.FontSizeProperty,
TextBlock.FontStyleProperty, TextBlock.FontWeightProperty, TextBlock.FontFamilyProperty);
@@ -87,7 +87,7 @@ namespace Avalonia.Controls.Presenters
TextBlock.FontSizeProperty.Changed, TextBlock.FontStyleProperty.Changed,
TextBlock.FontWeightProperty.Changed, TextBlock.FontFamilyProperty.Changed,
SelectionStartProperty.Changed, SelectionEndProperty.Changed,
- SelectionForegroundBrushProperty.Changed, PasswordCharProperty.Changed, ShowPasswordCharProperty.Changed
+ SelectionForegroundBrushProperty.Changed, PasswordCharProperty.Changed, ShowPasswordTextProperty.Changed
).AddClassHandler((x, _) => x.InvalidateFormattedText());
CaretIndexProperty.Changed.AddClassHandler((x, e) => x.CaretIndexChanged((int)e.NewValue));
@@ -213,10 +213,10 @@ namespace Avalonia.Controls.Presenters
set => SetValue(PasswordCharProperty, value);
}
- public bool ShowPasswordChar
+ public bool ShowPasswordText
{
- get => GetValue(ShowPasswordCharProperty);
- set => SetValue(ShowPasswordCharProperty, value);
+ get => GetValue(ShowPasswordTextProperty);
+ set => SetValue(ShowPasswordTextProperty, value);
}
public IBrush SelectionBrush
@@ -435,7 +435,7 @@ namespace Avalonia.Controls.Presenters
var text = Text;
- if (PasswordChar != default(char) && ShowPasswordChar)
+ if (PasswordChar != default(char) && !ShowPasswordText)
{
result = CreateFormattedTextInternal(_constraint, new string(PasswordChar, text?.Length ?? 0));
}
diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs
index 08e4e923f5..489937147f 100644
--- a/src/Avalonia.Controls/TextBox.cs
+++ b/src/Avalonia.Controls/TextBox.cs
@@ -101,8 +101,8 @@ namespace Avalonia.Controls
public static readonly StyledProperty