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
{
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

8
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;
/// <inheritdoc />
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;
}
/// <summary>

Loading…
Cancel
Save