ObservableDataSource, AppendAsync, SuspendUpdate

Jan 21, 2011 at 4:57 PM

In the method AppendAsync on the ObservableDataSource it does not check if SuspendUpdate has been called. I would have assumed that it should. Changing the method to what is shown below seems to work for me: 

    public void AppendAsync(Dispatcher dispatcher, T item)
    {
      if (updatesEnabled)
      {
        dispatcher.Invoke(DispatcherPriority.Normal,
          new Action(() => {collection.Add(item); RaiseDataChanged(); }));
      }
      else
      {
        dispatcher.Invoke(DispatcherPriority.Normal, new Action( () => {collection.Add(item);} ));
      }
    }

Regards,

Jacob