This question is locked. New answers and comments are not allowed.
1. I had found several threads about that, but either description was not complete, or answer was a bit blurry. Anyway, i'm also facing this problem. While having a list of several dozen items, it scrolls perfectly, but scrollbar is moving jerky indeed.
Sample (not mine, just was testing it, and found problem there), where you can see jerking of scrollbar (i got it on Lumia 920 device):
https://skydrive.live.com/redir.aspx?cid=0c89662af4d9c150&resid=C89662AF4D9C150!335&parid=C89662AF4D9C150!334
2. I hate those bloody callbacks, so i switched to Bcl library. Now, i'm trying to fill Listbox with own data, but somehow, page is always waiting for async call to be finished.
So, xaml:
<telerikPrimitives:RadDataBoundListBox
Grid.Row="1"
EmptyContent=""
DataVirtualizationMode="Automatic"
CacheMode="BitmapCache"
ItemTemplate="{StaticResource ProductsListViewerItemTemplate}"
ItemsSource="{Binding VirtualDataCollection}"
>
ViewModel:
VirtualDataCollection = new VirtualizingDataCollection(Constants.PAGE_SIZE, Constants.PAGE_SIZE);
VirtualDataCollection.ItemsLoading += VirtualDataCollectionOnItemsLoading;
async private void VirtualDataCollectionOnItemsLoading(object sender, VirtualizingDataCollectionItemsLoadingEventArgs e)
{
var answer = await _dataService.RequestServerAsync(SelectedIndex, e.StartIndex, e.Count);
if (answer.Status == AnswerDataServiceStatus.Ok) // Added breakpoint here, page is freezing and waiting for this line
{
DispatcherHelper.CheckBeginInvokeOnUI(() =>
VirtualDataCollection.LoadItems(e.StartIndex, answer.Collection));
}
}
DataService:
public async Task<ProductAnswer> RequestServerAsync(string categoryId, int startIndex, int pagesize)
{
Thread.Sleep(5000);
return new ProductAnswer
{
Status = AnswerDataServiceStatus.Ok,
Collection =
new List<ProductItem> {new ProductItem {name = "One"}, new ProductItem {name = "Two"}}
};
}
Sample (not mine, just was testing it, and found problem there), where you can see jerking of scrollbar (i got it on Lumia 920 device):
https://skydrive.live.com/redir.aspx?cid=0c89662af4d9c150&resid=C89662AF4D9C150!335&parid=C89662AF4D9C150!334
2. I hate those bloody callbacks, so i switched to Bcl library. Now, i'm trying to fill Listbox with own data, but somehow, page is always waiting for async call to be finished.
So, xaml:
<telerikPrimitives:RadDataBoundListBox
Grid.Row="1"
EmptyContent=""
DataVirtualizationMode="Automatic"
CacheMode="BitmapCache"
ItemTemplate="{StaticResource ProductsListViewerItemTemplate}"
ItemsSource="{Binding VirtualDataCollection}"
>
ViewModel:
VirtualDataCollection = new VirtualizingDataCollection(Constants.PAGE_SIZE, Constants.PAGE_SIZE);
VirtualDataCollection.ItemsLoading += VirtualDataCollectionOnItemsLoading;
async private void VirtualDataCollectionOnItemsLoading(object sender, VirtualizingDataCollectionItemsLoadingEventArgs e)
{
var answer = await _dataService.RequestServerAsync(SelectedIndex, e.StartIndex, e.Count);
if (answer.Status == AnswerDataServiceStatus.Ok) // Added breakpoint here, page is freezing and waiting for this line
{
DispatcherHelper.CheckBeginInvokeOnUI(() =>
VirtualDataCollection.LoadItems(e.StartIndex, answer.Collection));
}
}
DataService:
public async Task<ProductAnswer> RequestServerAsync(string categoryId, int startIndex, int pagesize)
{
Thread.Sleep(5000);
return new ProductAnswer
{
Status = AnswerDataServiceStatus.Ok,
Collection =
new List<ProductItem> {new ProductItem {name = "One"}, new ProductItem {name = "Two"}}
};
}