Skip to content

Commit

Permalink
fix(pipspager): fix vertical pipspager when number of pips is more th…
Browse files Browse the repository at this point in the history
…an max visible pips
  • Loading branch information
ramezgerges committed Dec 14, 2023
1 parent 9e763d5 commit 1114856
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/Uno.UI/Microsoft/UI/Xaml/Controls/PipsPager/PipsPager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,29 @@ protected override Size MeasureOverride(Size availableSize)
{
if (m_pipsPagerScrollViewer?.Presenter is { } presenter)
{
var canHorizontallyScroll = presenter.CanHorizontallyScroll;
presenter.CanHorizontallyScroll = true;
bool canScroll;
if (Orientation is Orientation.Horizontal)
{
canScroll = presenter.CanHorizontallyScroll;
presenter.CanHorizontallyScroll = true;
}
else
{
canScroll = presenter.CanVerticallyScroll;
presenter.CanVerticallyScroll = true;
}

var result = base.MeasureOverride(availableSize);
presenter.CanHorizontallyScroll = canHorizontallyScroll;

if (Orientation is Orientation.Horizontal)
{
presenter.CanHorizontallyScroll = canScroll;
}
else
{
presenter.CanVerticallyScroll = canScroll;
}

return result;
}

Expand Down

0 comments on commit 1114856

Please sign in to comment.