コード例 #1
0
        protected void OnCollectionChanged(VirtualCollectionSourceChangedEventArgs e)
        {
            var handler = CollectionChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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);
            }
        }