Browse Source

remove ScrollOrientation

pull/20549/head
Poker 1 month ago
parent
commit
a3dcbcea35
No known key found for this signature in database GPG Key ID: C65A6AD457D5C8F8
  1. 12
      src/Avalonia.Controls/Utils/OrientationBasedMeasures.cs
  2. 8
      src/Avalonia.Controls/WrapPanel.cs

12
src/Avalonia.Controls/Utils/OrientationBasedMeasures.cs

@ -1,16 +1,12 @@
namespace Avalonia.Controls.Utils; using Avalonia.Layout;
internal enum ScrollOrientation namespace Avalonia.Controls.Utils;
{
Horizontal,
Vertical
}
internal interface IOrientationBasedMeasures 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 internal static class OrientationBasedMeasuresExt

8
src/Avalonia.Controls/WrapPanel.cs

@ -165,9 +165,9 @@ namespace Avalonia.Controls
set => SetValue(ItemHeightProperty, value); 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;
/// <inheritdoc /> /// <inheritdoc />
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
@ -175,8 +175,8 @@ namespace Avalonia.Controls
base.OnPropertyChanged(change); base.OnPropertyChanged(change);
if (change.Property == OrientationProperty) if (change.Property == OrientationProperty)
ScrollOrientation = Orientation is Orientation.Horizontal ? ScrollOrientation = Orientation is Orientation.Horizontal ?
ScrollOrientation.Vertical : Orientation.Vertical :
ScrollOrientation.Horizontal; Orientation.Horizontal;
} }
/// <summary> /// <summary>

Loading…
Cancel
Save