VirtualizingStackPanel stops working when overriding the default control template for ScrollViewer
I have a listbox with a lot of items which are expensive to render. However the VirtualizingStackPanel takes care of that by only rendering the visible items. I want to override the control template for ScrollViewer since the default one has grey rectangle between the horizontal and vertical scrollbar. I just copied the one provided by Microsoft ( ScrollViewer ControlTemplate Example ) which do not have the grey rectangle issue. This controltemplate however disables virtualization by giving the VirtualizingStackPanel endless height. That means that the VirtualizingStackPanel will render all