protected void OnCollectionChanged(VirtualCollectionSourceChangedEventArgs e) { var handler = CollectionChanged; if (handler != null) { handler(this, e); } }
private void HandleSourceCollectionChanged(object sender, VirtualCollectionSourceChangedEventArgs e) { if (e.ChangeType == ChangeType.Refresh) { Task.Factory.StartNew(UpdateData, CancellationToken.None, TaskCreationOptions.None, _synchronizationContextScheduler); } else if (e.ChangeType == ChangeType.Reset) { Task.Factory.StartNew(Reset, CancellationToken.None, TaskCreationOptions.None, _synchronizationContextScheduler); } }
private void HandleSourceCollectionChanged(object sender, VirtualCollectionSourceChangedEventArgs e) { var stateWhenUpdateRequested = _state; if (e.ChangeType == ChangeType.Refresh) { Task.Factory.StartNew(() => UpdateData(stateWhenUpdateRequested), CancellationToken.None, TaskCreationOptions.None, _synchronizationContextScheduler); } else if (e.ChangeType == ChangeType.Reset) { Task.Factory.StartNew(() => Reset(stateWhenUpdateRequested), CancellationToken.None, TaskCreationOptions.None, _synchronizationContextScheduler); } }