From a3dcbcea35710af192151fba02a7a04efafa9e17 Mon Sep 17 00:00:00 2001 From: Poker Date: Wed, 11 Feb 2026 20:55:32 +0800 Subject: [PATCH] remove ScrollOrientation --- .../Utils/OrientationBasedMeasures.cs | 12 ++++-------- src/Avalonia.Controls/WrapPanel.cs | 8 ++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Avalonia.Controls/Utils/OrientationBasedMeasures.cs b/src/Avalonia.Controls/Utils/OrientationBasedMeasures.cs index 45328398b8..6d529d9a59 100644 --- a/src/Avalonia.Controls/Utils/OrientationBasedMeasures.cs +++ b/src/Avalonia.Controls/Utils/OrientationBasedMeasures.cs @@ -1,16 +1,12 @@ -namespace Avalonia.Controls.Utils; +using Avalonia.Layout; -internal enum ScrollOrientation -{ - Horizontal, - Vertical -} +namespace Avalonia.Controls.Utils; internal interface IOrientationBasedMeasures { - ScrollOrientation ScrollOrientation { get; } + Orientation ScrollOrientation { get; } - bool IsVertical => ScrollOrientation is ScrollOrientation.Vertical; + bool IsVertical => ScrollOrientation is Orientation.Vertical; } internal static class OrientationBasedMeasuresExt diff --git a/src/Avalonia.Controls/WrapPanel.cs b/src/Avalonia.Controls/WrapPanel.cs index f1f9306b80..7da3479c5f 100644 --- a/src/Avalonia.Controls/WrapPanel.cs +++ b/src/Avalonia.Controls/WrapPanel.cs @@ -165,9 +165,9 @@ namespace Avalonia.Controls set => SetValue(ItemHeightProperty, value); } - private ScrollOrientation ScrollOrientation { get; set; } = ScrollOrientation.Vertical; + private Orientation ScrollOrientation { get; set; } = Orientation.Vertical; - ScrollOrientation IOrientationBasedMeasures.ScrollOrientation => ScrollOrientation; + Orientation IOrientationBasedMeasures.ScrollOrientation => ScrollOrientation; /// protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) @@ -175,8 +175,8 @@ namespace Avalonia.Controls base.OnPropertyChanged(change); if (change.Property == OrientationProperty) ScrollOrientation = Orientation is Orientation.Horizontal ? - ScrollOrientation.Vertical : - ScrollOrientation.Horizontal; + Orientation.Vertical : + Orientation.Horizontal; } ///