title: How to update a collection that is bounded to the UI?
body: <p>I have followed <a href="https://msdn.microsoft.com/en-us/magazine/dn605875.aspx" rel="nofollow noreferrer">this</a> blog by Stephen Cleary and I was wondering what would be the best approach for update the existing collection that is bounded to the UI which updates every 15 seconds?
  For e.g. do I Clear the list then add a new collection to create a new object?</p>
  
  <p>I am asking this question because when I added this <code>Task taskA = Task.Run(() =&gt; UpdateManifest(_ManifestToken.Token));</code> line of code my CPU increase rapidly.</p>
  
  <p>C#:</p>
  
  <pre><code>// Ctor.
  public ManifestViewModel()
  {
      _ManifestItems = new NotifyTaskCompletion&lt;ObservableCollection&lt;ManifestItem&gt;&gt;(FetchData());
      Task taskA = Task.Run(() =&gt; UpdateManifest(_ManifestToken.Token));  
  }
  
  private NotifyTaskCompletion&lt;ObservableCollection&lt;ManifestItem&gt;&gt; _ManifestItems;
  public NotifyTaskCompletion&lt;ObservableCollection&lt;ManifestItem&gt;&gt; ManifestItems
  {
      get =&gt; _ManifestItems;
      set
      {
          if (_ManifestItems != value)
          {
              _ManifestItems = value;
              OnPropertyChanged();
          }
      } 
   }
  
  public static Task UpdateManifest(CancellationToken token)
  {
      while (true)
      {
          _ManifestItems = new NotifyTaskCompletion&lt;ObservableCollection&lt;ManifestItem&gt;&gt;(FetchData());
  
          Task.Delay(15000);
      }
  }
  </code></pre>