浏览代码

Merge pull request #10477 from workgroupengineering/fixes/Warnings/AVP-Misc

fix: AVP1021 and AVP1022
Max Katz 2 年之前
父节点
当前提交
498f68f659

+ 1 - 1
samples/ControlCatalog/Pages/PointerCanvas.cs

@@ -114,7 +114,7 @@ public class PointerCanvas : Control
 
     private string? _status;
     public static readonly DirectProperty<PointerCanvas, string?> StatusProperty =
-        AvaloniaProperty.RegisterDirect<PointerCanvas, string?>(nameof(DrawOnlyPoints), c => c.Status, (c, v) => c.Status = v,
+        AvaloniaProperty.RegisterDirect<PointerCanvas, string?>(nameof(Status), c => c.Status, (c, v) => c.Status = v,
             defaultBindingMode: Avalonia.Data.BindingMode.TwoWay);
 
     public string? Status

+ 6 - 3
src/Avalonia.Controls/MaskedTextBox.cs

@@ -31,9 +31,6 @@ namespace Avalonia.Controls
         public static readonly StyledProperty<string?> MaskProperty =
              AvaloniaProperty.Register<MaskedTextBox, string?>(nameof(Mask), string.Empty);
 
-        public static new readonly StyledProperty<char> PasswordCharProperty =
-             AvaloniaProperty.Register<MaskedTextBox, char>(nameof(PasswordChar), '\0');
-
         public static readonly StyledProperty<char> PromptCharProperty =
              AvaloniaProperty.Register<MaskedTextBox, char>(nameof(PromptChar), '_');
 
@@ -51,6 +48,12 @@ namespace Avalonia.Controls
 
         private bool _resetOnSpace = true;
 
+        static MaskedTextBox()
+        {
+            PasswordCharProperty
+                .OverrideDefaultValue<MaskedTextBox>('\0');
+        }
+
         public MaskedTextBox() { }
 
         /// <summary>

+ 1 - 1
src/Avalonia.Diagnostics/Diagnostics/Controls/ThicknessEditor.cs

@@ -15,7 +15,7 @@ namespace Avalonia.Diagnostics.Controls
                 (o, v) => o.Header = v);
 
         public static readonly DirectProperty<ThicknessEditor, bool> IsPresentProperty =
-            AvaloniaProperty.RegisterDirect<ThicknessEditor, bool>(nameof(Header), o => o.IsPresent,
+            AvaloniaProperty.RegisterDirect<ThicknessEditor, bool>(nameof(IsPresent), o => o.IsPresent,
                 (o, v) => o.IsPresent = v);
 
         public static readonly DirectProperty<ThicknessEditor, double> LeftProperty =