Browse Source

fix: Address Rule AVP1010 AvaloniaProperty owner {type} , which is not the containing type

fixes:

```bash
Warning AVP1010 Type mismatch: AvaloniaProperty owner is Avalonia.Controls.MenuItem, which is not the containing type Avalonia.Controls (net6.0) .\src\Avalonia.Controls\TrayIcon.cs 98 Active
Warning AVP1010 Type mismatch: AvaloniaProperty owner is Avalonia.Controls.MenuItem, which is not the containing type Avalonia.Controls (net6.0) .\src\Avalonia.Controls\NativeMenuItem.cs 140 Active
Warning AVP1010 Type mismatch: AvaloniaProperty owner is Avalonia.Controls.Control, which is not the containing type Avalonia.Controls (net6.0) .\src\Avalonia.Controls\Primitives\AdornerLayer.cs 41 Active
Warning AVP1010 Type mismatch: AvaloniaProperty owner is Avalonia.Application, which is not the containing type Avalonia.Controls (net6.0) .\src\Avalonia.Controls\TopLevel.cs 85 Active
Warning AVP1010 Type mismatch: AvaloniaProperty owner is Avalonia.Application, which is not the containing type Avalonia.Controls (net6.0) .\src\Avalonia.Controls\TopLevel.cs 89 Active
Warning AVP1010 Type mismatch: AvaloniaProperty owner is Avalonia.Controls.StackPanel, which is not the containing type Avalonia.Controls.ItemsRepeater (netstandard2.0) .\src\Avalonia.Controls.ItemsRepeater\Layout\StackLayout.cs 29 Active
```
pull/10466/head
Giuseppe Lippolis 4 years ago
parent
commit
24ebe441f6
  1. 2
      src/Avalonia.Controls.ItemsRepeater/Layout/StackLayout.cs
  2. 2
      src/Avalonia.Controls/NativeMenuItem.cs
  3. 3
      src/Avalonia.Controls/Primitives/AdornerLayer.cs
  4. 2
      src/Avalonia.Controls/TrayIcon.cs

2
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.

2
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);

3
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");

2
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.

Loading…
Cancel
Save