1
0
Эх сурвалжийг харах

Merge pull request #1850 from MihaMarkic/passwordchar_affects_render

Fixes #1847 PasswordChar change doesn't affect render
Jumar Macato 7 жил өмнө
parent
commit
d0b05adf8a

+ 8 - 0
src/Avalonia.Controls/Presenters/TextPresenter.cs

@@ -35,6 +35,11 @@ namespace Avalonia.Controls.Presenters
         private int _selectionEnd;
         private bool _caretBlink;
         private IBrush _highlightBrush;
+        
+        static TextPresenter()
+        {
+            AffectsRender(PasswordCharProperty);
+        }
 
         public TextPresenter()
         {
@@ -49,6 +54,9 @@ namespace Avalonia.Controls.Presenters
 
             this.GetObservable(CaretIndexProperty)
                 .Subscribe(CaretIndexChanged);
+
+            this.GetObservable(PasswordCharProperty)
+                .Subscribe(_ => InvalidateFormattedText());
         }
 
         public int CaretIndex