Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I couldn't fit this in a comment -- try this:</p> <pre><code>public class BackgroundTransferRequestWrapper : INotifyPropertyChanged { private BackgroundTransferRequest _request; public BackgroundTransferRequestWrapper(BackgroundTransferRequest request) { _request = request; _request.TransferProgressChanged += OnTransferProgressChanged; } private void OnTransferProgressChanged(object sender, BackgroundTransferEventArgs e) { BytesReceived = _request.BytesReceived; TotalBytesToReceive = _request.TotalBytesToReceive; } private long bytesReceived = 0; public long BytesReceived { get { return bytesReceived; } set { bytesReceived = value; OnPropertyChanged(); } } private long totalBytesToReceive = 0; public long TotalBytesToReceive { get { return totalBytesToReceive; } set { totalBytesToReceive = value; OnPropertyChanged();} } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); } } </code></pre> <p>Instead of resetting the ItemsSource on a timer, instead just do this:</p> <pre><code> foreach (var request in BackgroundTransferService.Requests) { Requests.Add(new BackgroundTransferRequestWrapper(request)); } </code></pre> <p>In this example, <strong>Requests</strong> is an ObservableCollection bound to your ItemsSource. With this you shouldn't need to update manually at all -- the BackgroundTransferRequest events will drive the wrapper to notify prop changes as they happen.</p> <p>I didn't test your example fully, but I suspect your issue has something to do with LongListSelector's UI virtualization and the way you're constantly resetting ItemsSource. Another possibility is the order of the requests might change every time you get them from BackgroundTransferService.</p> <p>Good luck!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload