In my WP8 app I use Background Transfer Sevice and LongListSelector
with ProgressBar
as it's DataTemplate
to display items download progress to user. The problem is that ProgressBar
does not show real progress but keeps jumping back and forth.
Here's my XAML. LongListSelector
periodically recieves a list of BackgroundTransferRequest
's and uses
ProgressBar
to display them:
<phone:LongListSelector IsGroupingEnabled="False" x:Name="Views">
<phone:LongListSelector.ListHeader>
<StackPanel Style="{StaticResource M20}">
<controls:TextTile Txt="Cancel downloads" Sign="x" Tap="CancelDownloads" />
</StackPanel>
</phone:LongListSelector.ListHeader>
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<ProgressBar Maximum="{Binding TotalBytesToReceive}" Value="{Binding BytesReceived}" Minimum="0" />
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
LongListSelector
gets updated periodically from code behind class:
Views.ItemsSource = BackgroundTransferService.Requests.ToList()
This issue happens in LongListSelector
only in case if more than one item is displayed. Everything works fine If I try to use ListBox
for example. Why is this thing happening and what should I do to fix it?