Browse Source

Merge pull request #8114 from wieslawsoltes/fixes/PropertyNames

Fix property registrations
Max Katz 3 years ago
parent
commit
204b4c1551

+ 1 - 1
src/Avalonia.Base/Layout/UniformGridLayout.cs

@@ -116,7 +116,7 @@ namespace Avalonia.Layout
         /// Defines the <see cref="MaximumRowsOrColumnsProperty"/> property.
         /// </summary>
         public static readonly StyledProperty<int> MaximumRowsOrColumnsProperty =
-            AvaloniaProperty.Register<UniformGridLayout, int>(nameof(MinItemWidth));
+            AvaloniaProperty.Register<UniformGridLayout, int>(nameof(MaximumRowsOrColumns));
 
         /// <summary>
         /// Defines the <see cref="Orientation"/> property.

+ 2 - 2
src/Avalonia.Base/Media/ConicGradientBrush.cs

@@ -11,7 +11,7 @@ namespace Avalonia.Media
         /// Defines the <see cref="Center"/> property.
         /// </summary>
         public static readonly StyledProperty<RelativePoint> CenterProperty =
-            AvaloniaProperty.Register<RadialGradientBrush, RelativePoint>(
+            AvaloniaProperty.Register<ConicGradientBrush, RelativePoint>(
                 nameof(Center),
                 RelativePoint.Center);
 
@@ -19,7 +19,7 @@ namespace Avalonia.Media
         /// Defines the <see cref="Angle"/> property.
         /// </summary>
         public static readonly StyledProperty<double> AngleProperty =
-            AvaloniaProperty.Register<RadialGradientBrush, double>(
+            AvaloniaProperty.Register<ConicGradientBrush, double>(
                 nameof(Angle),
                 0);
         

+ 1 - 1
src/Avalonia.Controls/ContextMenu.cs

@@ -63,7 +63,7 @@ namespace Avalonia.Controls
         /// Defines the <see cref="PlacementRect"/> property.
         /// </summary>
         public static readonly StyledProperty<Rect?> PlacementRectProperty =
-            AvaloniaProperty.Register<Popup, Rect?>(nameof(PlacementRect));
+            Popup.PlacementRectProperty.AddOwner<ContextMenu>();
 
         /// <summary>
         /// Defines the <see cref="WindowManagerAddShadowHint"/> property.

+ 1 - 1
src/Avalonia.Controls/DockPanel.cs

@@ -34,7 +34,7 @@ namespace Avalonia.Controls
         /// </summary>
         public static readonly StyledProperty<bool> LastChildFillProperty =
             AvaloniaProperty.Register<DockPanel, bool>(
-                nameof(LastChildFillProperty),
+                nameof(LastChildFill),
                 defaultValue: true);
 
         /// <summary>

+ 1 - 1
src/Avalonia.Controls/MaskedTextBox.cs

@@ -32,7 +32,7 @@ namespace Avalonia.Controls
              AvaloniaProperty.Register<MaskedTextBox, string?>(nameof(Mask), string.Empty);
 
         public static new readonly StyledProperty<char> PasswordCharProperty =
-             AvaloniaProperty.Register<TextBox, char>(nameof(PasswordChar), '\0');
+             AvaloniaProperty.Register<MaskedTextBox, char>(nameof(PasswordChar), '\0');
 
         public static readonly StyledProperty<char> PromptCharProperty =
              AvaloniaProperty.Register<MaskedTextBox, char>(nameof(PromptChar), '_');

+ 3 - 3
src/Avalonia.Controls/Presenters/TextPresenter.cs

@@ -26,13 +26,13 @@ namespace Avalonia.Controls.Presenters
             AvaloniaProperty.Register<TextPresenter, char>(nameof(PasswordChar));
 
         public static readonly StyledProperty<IBrush?> SelectionBrushProperty =
-            AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionBrushProperty));
+            AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionBrush));
 
         public static readonly StyledProperty<IBrush?> SelectionForegroundBrushProperty =
-            AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionForegroundBrushProperty));
+            AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(SelectionForegroundBrush));
 
         public static readonly StyledProperty<IBrush?> CaretBrushProperty =
-            AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(CaretBrushProperty));
+            AvaloniaProperty.Register<TextPresenter, IBrush?>(nameof(CaretBrush));
 
         public static readonly DirectProperty<TextPresenter, int> SelectionStartProperty =
             TextBox.SelectionStartProperty.AddOwner<TextPresenter>(

+ 1 - 1
src/Avalonia.Controls/Primitives/Popup.cs

@@ -27,7 +27,7 @@ namespace Avalonia.Controls.Primitives
 #pragma warning restore CS0612 // Type or member is obsolete
     {
         public static readonly StyledProperty<bool> WindowManagerAddShadowHintProperty =
-            AvaloniaProperty.Register<PopupRoot, bool>(nameof(WindowManagerAddShadowHint), false);
+            AvaloniaProperty.Register<Popup, bool>(nameof(WindowManagerAddShadowHint), false);
 
         /// <summary>
         /// Defines the <see cref="Child"/> property.

+ 1 - 1
src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

@@ -94,7 +94,7 @@ namespace Avalonia.Controls.Primitives
         /// Defines the <see cref="IsTextSearchEnabled"/> property.
         /// </summary>
         public static readonly StyledProperty<bool> IsTextSearchEnabledProperty =
-            AvaloniaProperty.Register<ItemsControl, bool>(nameof(IsTextSearchEnabled), false);
+            AvaloniaProperty.Register<SelectingItemsControl, bool>(nameof(IsTextSearchEnabled), false);
 
         /// <summary>
         /// Event that should be raised by items that implement <see cref="ISelectable"/> to

+ 3 - 3
src/Avalonia.Controls/Primitives/Track.cs

@@ -44,7 +44,7 @@ namespace Avalonia.Controls.Primitives
             AvaloniaProperty.Register<Track, bool>(nameof(IsDirectionReversed));
 
         public static readonly StyledProperty<bool> IgnoreThumbDragProperty =
-            AvaloniaProperty.Register<Track, bool>(nameof(IsThumbDragHandled));
+            AvaloniaProperty.Register<Track, bool>(nameof(IgnoreThumbDrag));
 
         private double _minimum;
         private double _maximum = 100.0;
@@ -118,7 +118,7 @@ namespace Avalonia.Controls.Primitives
             set { SetValue(IsDirectionReversedProperty, value); }
         }
 
-        public bool IsThumbDragHandled
+        public bool IgnoreThumbDrag
         {
             get { return GetValue(IgnoreThumbDragProperty); }
             set { SetValue(IgnoreThumbDragProperty, value); }
@@ -442,7 +442,7 @@ namespace Avalonia.Controls.Primitives
 
         private void ThumbDragged(object? sender, VectorEventArgs e)
         {
-            if (IsThumbDragHandled)
+            if (IgnoreThumbDrag)
                 return;
                 
             Value = MathUtilities.Clamp(

+ 2 - 2
src/Avalonia.Controls/Slider.cs

@@ -76,7 +76,7 @@ namespace Avalonia.Controls
         /// Defines the <see cref="TickPlacement"/> property.
         /// </summary>
         public static readonly StyledProperty<TickPlacement> TickPlacementProperty =
-            AvaloniaProperty.Register<TickBar, TickPlacement>(nameof(TickPlacement), 0d);
+            AvaloniaProperty.Register<Slider, TickPlacement>(nameof(TickPlacement), 0d);
 
         /// <summary>
         /// Defines the <see cref="TicksProperty"/> property.
@@ -197,7 +197,7 @@ namespace Avalonia.Controls
 
             if (_track != null)
             {
-                _track.IsThumbDragHandled = true;
+                _track.IgnoreThumbDrag = true;
             }
 
             if (_decreaseButton != null)

+ 1 - 1
src/Avalonia.Controls/SplitView.cs

@@ -138,7 +138,7 @@ namespace Avalonia.Controls
         /// Defines the <see cref="PaneTemplate"/> property.
         /// </summary>
         public static readonly StyledProperty<IDataTemplate> PaneTemplateProperty =
-            AvaloniaProperty.Register<HeaderedContentControl, IDataTemplate>(nameof(PaneTemplate));
+            AvaloniaProperty.Register<SplitView, IDataTemplate>(nameof(PaneTemplate));
 
         /// <summary>
         /// Defines the <see cref="UseLightDismissOverlayMode"/> property

+ 3 - 3
src/Avalonia.Controls/TextBox.cs

@@ -55,13 +55,13 @@ namespace Avalonia.Controls
             AvaloniaProperty.Register<TextBox, char>(nameof(PasswordChar));
 
         public static readonly StyledProperty<IBrush?> SelectionBrushProperty =
-            AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionBrushProperty));
+            AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionBrush));
 
         public static readonly StyledProperty<IBrush?> SelectionForegroundBrushProperty =
-            AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionForegroundBrushProperty));
+            AvaloniaProperty.Register<TextBox, IBrush?>(nameof(SelectionForegroundBrush));
 
         public static readonly StyledProperty<IBrush?> CaretBrushProperty =
-            AvaloniaProperty.Register<TextBox, IBrush?>(nameof(CaretBrushProperty));
+            AvaloniaProperty.Register<TextBox, IBrush?>(nameof(CaretBrush));
 
         public static readonly DirectProperty<TextBox, int> SelectionStartProperty =
             AvaloniaProperty.RegisterDirect<TextBox, int>(