Răsfoiți Sursa

Merge pull request #10466 from workgroupengineering/fixes/Warnings/AVP1010

fix: Address Rule AVP1010 AvaloniaProperty owner {type} , which is not the containing type
Max Katz 2 ani în urmă
părinte
comite
621f3ed767

+ 1 - 1
src/Avalonia.Controls.ItemsRepeater/Layout/StackLayout.cs

@@ -26,7 +26,7 @@ namespace Avalonia.Layout
         /// Defines the <see cref="Orientation"/> property.
         /// </summary>
         public static readonly StyledProperty<Orientation> OrientationProperty =
-            StackPanel.OrientationProperty.AddOwner<StackPanel>();
+            StackPanel.OrientationProperty.AddOwner<StackLayout>();
 
         /// <summary>
         /// Defines the <see cref="Spacing"/> property.

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

@@ -137,7 +137,7 @@ namespace Avalonia.Controls
         /// Defines the <see cref="CommandParameter"/> property.
         /// </summary>
         public static readonly StyledProperty<object?> CommandParameterProperty =
-            Button.CommandParameterProperty.AddOwner<MenuItem>();
+            Button.CommandParameterProperty.AddOwner<NativeMenuItem>();
 
         public static readonly DirectProperty<NativeMenuItem, bool> IsEnabledProperty =
            AvaloniaProperty.RegisterDirect<NativeMenuItem, bool>(nameof(IsEnabled), o => o.IsEnabled, (o, v) => o.IsEnabled = v, true);

+ 1 - 2
src/Avalonia.Controls/Primitives/AdornerLayer.cs

@@ -2,7 +2,6 @@ using System;
 using System.Collections.Specialized;
 using Avalonia.Media;
 using Avalonia.Reactive;
-using Avalonia.Rendering;
 using Avalonia.VisualTree;
 
 namespace Avalonia.Controls.Primitives
@@ -38,7 +37,7 @@ namespace Avalonia.Controls.Primitives
         /// Defines the <see cref="DefaultFocusAdorner"/> property.
         /// </summary>
         public static readonly StyledProperty<ITemplate<Control>?> DefaultFocusAdornerProperty =
-            AvaloniaProperty.Register<Control, ITemplate<Control>?>(nameof(DefaultFocusAdorner));
+            AvaloniaProperty.Register<AdornerLayer, ITemplate<Control>?>(nameof(DefaultFocusAdorner));
         
         private static readonly AttachedProperty<AdornedElementInfo?> s_adornedElementInfoProperty =
             AvaloniaProperty.RegisterAttached<AdornerLayer, Visual, AdornedElementInfo?>("AdornedElementInfo");

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

@@ -95,7 +95,7 @@ namespace Avalonia.Controls
         /// Defines the <see cref="CommandParameter"/> property.
         /// </summary>
         public static readonly StyledProperty<object?> CommandParameterProperty =
-            Button.CommandParameterProperty.AddOwner<MenuItem>();
+            Button.CommandParameterProperty.AddOwner<TrayIcon>();
 
         /// <summary>
         /// Defines the <see cref="TrayIcons"/> attached property.