ItemsControl with ItemsSource+VirtualizedStackPanel : bad scrollbar position after removing some items (different items heights)
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
I have an ItemsControl with an ItemsSource and a VirtualizedStackPanel. Items have different heights.
I move the scrollbar to the bottom of ItemsControls.
I remove some items, so that scrollbar is still visible.
Resulting scrollbar position is invalid : only some of items which should be visible are on screen.
### Reproduction Steps
Use the provided sample project : start the application than click on "Click to make bug appear" button.
Both ItemsControl should be at the same scroll position, but they are not.
See attached picture.

Here is the sample project, to reproduce the problem.
[SampleProject.zip](https://github.com/dotnet/wpf/files/15209473/SampleProject.zip)
### Expected behavior
See the sample project : both itemsControl should be at the same scrolling position.
### Actual behavior
See the sample project : both itemsControl are not at the same scrolling position.
### Regression?
_No response_
### Known Workarounds
_No response_
### Impact
_No response_
### Configuration
_No response_
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.