Closed melinyi closed 2 years ago
I know that this may be a lot of generation and recycling caused by dragging the scrollbar. Would you consider adding timeout to handle this to determine whether the scrollbar really stops dragging
I effectively delayed loading by doing the following
XAML: ScrollViewer.IsDeferredScrollingEnabled="True" ScrollBar.Scroll="VirtualizingItemsControl_Scroll"
C# code:
private void VirtualizingItemsControl_Scroll(object sender, System.Windows.Controls.Primitives.ScrollEventArgs e)
{
Token = DateTime.Now.Ticks;
SetTimeOut(Token, e.NewValue);
}
private long Token = 0;
private async void SetTimeOut(long token, double newValue)
{
await Task.Delay(100);
if (token != Token) return;
ScrollViewer.ScrollToVerticalOffset(newValue);
}
When loading a lot of Viewitem (images and convert), dragging the scrollbar directly can be a bit sluggish
I've set the image to Async, but it's not working very well