Poker
1 month ago
No known key found for this signature in database
GPG Key ID: C65A6AD457D5C8F8
2 changed files with
8 additions and
12 deletions
-
src/Avalonia.Controls/Utils/OrientationBasedMeasures.cs
-
src/Avalonia.Controls/WrapPanel.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 |
|
|
|
|
|
@ -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>
|
|
|
|