From de4bc3c6e02013bfedd10931cc04f7589f086517 Mon Sep 17 00:00:00 2001 From: Felipe Quintella Date: Mon, 16 Dec 2024 10:11:47 -0300 Subject: [PATCH 1/4] Several nullability adjustments --- src/Aura.UI/Aura.UI.csproj | 10 +++--- .../AuraTabItem/AuraTabItem.Events.cs | 2 +- .../Controls/AuraTabItem/AuraTabItem.cs | 9 +++-- .../Controls/AuraTabView/AuraTabView.cs | 31 +++++++++++----- src/Aura.UI/Controls/Badge/Badge.cs | 35 ++++++++++--------- .../CardCollection/CardControl.Properties.cs | 8 ++--- .../Controls/CardCollection/CardControl.cs | 6 ++-- .../Colouring/ColorSquare/ColorSquare.cs | 5 ++- .../Controls/ContentDialog/ContentDialog.cs | 18 +++++++--- .../FloatingButtonBar/FloatingButtonBar.cs | 6 ++-- .../Controls/MessageDialog/MessageDialog.cs | 11 ++++-- .../NavigationView/NavigationView.cs | 25 +++++++++---- .../NavigationView/NavigationViewItem.cs | 7 ++-- .../NavigationViewItemBase.Properties.cs | 16 ++++++--- .../NavigationView/NavigationViewItemBase.cs | 1 + .../NavigationViewLinker.Properties.cs | 8 ++--- .../NavigationView/NavigationViewLinker.cs | 4 +-- .../Controls/Primitives/ContentDialogBase.cs | 12 ++++++- .../Controls/Primitives/WindowButtons.cs | 11 ++++-- src/Aura.UI/Controls/Ribbon/Ribbon.cs | 8 +++-- src/Aura.UI/Controls/Ribbon/RibbonGroup.cs | 8 +++-- src/Aura.UI/Controls/Ribbon/RibbonItem.cs | 10 ++++-- .../Sliders/RadialSlider.Properties.cs | 6 ++-- src/Aura.UI/Controls/Thumbs/ResizeThumb.cs | 11 ++++-- .../BoundsToCornerRadiusConverter.cs | 8 ++--- src/Aura.UI/Converters/HSVToColorConverter.cs | 17 ++++++--- .../IntToColumnDefinitionWidthConverter.cs | 8 +++-- .../Converters/SideByWidthConverter.cs | 10 ++++-- .../Converters/WidthInsideCircularCrown.cs | 18 ++++++---- src/Aura.UI/Extensions/LogicalExtensions.cs | 8 ++--- src/Aura.UI/Extensions/RibbonExtensions.cs | 13 ++++++- .../Extensions/TemplatedControlExtensions.cs | 14 ++++++-- src/Aura.UI/Extensions/VisualExtensions.cs | 2 +- .../Rendering/AuraDrawOperationBase.cs | 2 +- src/Aura.UI/Rendering/ColorSquareRender.cs | 2 +- src/Aura.UI/Services/ContentDialogService.cs | 13 ++++--- src/Aura.UI/Services/MessageDialogService.cs | 2 +- 37 files changed, 261 insertions(+), 124 deletions(-) diff --git a/src/Aura.UI/Aura.UI.csproj b/src/Aura.UI/Aura.UI.csproj index 278e314..4989238 100644 --- a/src/Aura.UI/Aura.UI.csproj +++ b/src/Aura.UI/Aura.UI.csproj @@ -4,6 +4,7 @@ Control's Library for Avalonia. AuraUILogo_full_icon.png true + enable @@ -18,14 +19,15 @@ - - - - + + + + + diff --git a/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.Events.cs b/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.Events.cs index c3ecd51..7c10a93 100644 --- a/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.Events.cs +++ b/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.Events.cs @@ -10,7 +10,7 @@ public partial class AuraTabItem /// /// /// - protected virtual void OnClosing(object sender, RoutedEventArgs e) + protected virtual void OnClosing(object? sender, RoutedEventArgs e) { IsClosing = true; } diff --git a/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.cs b/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.cs index 4edbd5b..078ff47 100644 --- a/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.cs +++ b/src/Aura.UI/Controls/AuraTabItem/AuraTabItem.cs @@ -15,7 +15,7 @@ namespace Aura.UI.Controls [PseudoClasses(":dragging", ":lockdrag")] public partial class AuraTabItem : TabItem, ICustomCornerRadius { - private Button CloseButton; + private Button? CloseButton; public AuraTabItem() { @@ -85,8 +85,11 @@ protected void OnCanDraggablePropertyChanged(object sender, AvaloniaPropertyChan protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); + + var closeButton = this.GetControl