You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a Vertical VirtualizingStackPanel, the Vertical scroll bar size is not correct until the view is scroll down to its maximum.
Incorrect (Current)
Expected
Sorry for the bad pictures, this is part of an app I'm working on. The current hack I am using is to force a ScrollIntoView of the last item
privatevoidEnsureScrollBars(){intcurrentPage= SelectedPageIndex.HasValue ? SelectedPageIndex.Value -1:0;try{_isSettingPageVisibility=true;// There's a bug in VirtualizingStackPanel. Scroll bars do not display correctly// This hack fixes that by scrolling into view a page that's not realisedif(currentPage >= GetMinPageIndex()&¤tPage <= GetMaxPageIndex()){// Current page is realisedif(currentPage!=0){
ScrollIntoView(0);}elseif(currentPage!=PageCount-1){
ScrollIntoView(PageCount-1);}}}finally{_isSettingPageVisibility=false;
ScrollIntoView(currentPage);}}
After investigation, it is my understanding that the problem comes from the VirtualizingStackPanel.MeasureOverride(..):
The CalculateDesiredSize(...) is called before the _lastEstimatedElementSizeU variable is set (i.e. the default value 25 is used).
Describe the bug
When using a Vertical
VirtualizingStackPanel
, the Vertical scroll bar size is not correct until the view is scroll down to its maximum.Incorrect (Current)
Expected
Sorry for the bad pictures, this is part of an app I'm working on. The current hack I am using is to force a ScrollIntoView of the last item
After investigation, it is my understanding that the problem comes from the
VirtualizingStackPanel.MeasureOverride(..)
:The
CalculateDesiredSize(...)
is called before the_lastEstimatedElementSizeU
variable is set (i.e. the default value 25 is used).I will create a PR to fix this issue
To Reproduce
See https://github.com/BobLd/Caly
I'm currently using a hack in
PdfPageItemsControl
(seeEnsureScrollBars()
)I you comment this code and open a pdf document with the app, you will see that the vertical scroll bar is not correct
Expected behavior
No response
Avalonia version
11.2.0
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: