title: Refresing data in DataGrid is too "Flashy"
body: <p>I have a method in a <strong>DispatcherTimer</strong> that refreshes my datagrid's data every 3 seconds. (3 seconds for testing purposes)</p>
  
  <p>The thing is that every time my datagrid gets refreshed, it clears all the data and then loads the data again from my database(obviously). Now my issue is that it creates this <strong>"flashy"</strong> effect each time the data loads, because of all the rows being cleared and the re-loaded into the datagrid. </p>
  
  <p>So my question is, (after you have taken a look at my code below) is there a better way of loading the data again and again without creating the flashing effect in my datagrid?</p>
  
  <p>My method where I call my data from my WCF service:</p>
  
  <pre><code>public async Task LoadTrucks()
  {
      using (TruckServiceClient service = new TruckServiceClient())
      {
          List&lt;ClientItems&gt; truckitems = new List&lt;ClientItems&gt;();
          if (dgViewProjects.Items.Count &lt;= 0)
          {
              foreach (var item in await service.GetTrucksAsync())
              {
                  truckitems.Add(new ClientItems
                  {
                      TruckQuoteId = item.QuoteId,
                      TruckChassisManufacturer = item.ChassisManufacturer,
                      TruckChassisModel = item.ChassisModel,
                      TruckStatus = item.Status,
                      TruckJobNumber = item.JobNumbers,
                      TruckAddedBy = item.AddedBy,
                      TruckClient = item.ClientName
                  });
              }
          }
          dgViewProjects.ItemsSource = (truckitems.ToArray());
      }
  }
  </code></pre>
  
  <p>Here I call the <code>LoadTrucks()</code> method and create my DispatcherTimer:</p>
  
  <pre><code>private async void dgViewProjects_Loaded(object sender, RoutedEventArgs e)
  {
      await LoadTrucks();
  
      var timer = new DispatcherTimer();
      timer.Interval = TimeSpan.FromSeconds(3);
      timer.Tick += new EventHandler(async (object o, EventArgs t) =&gt;
      {
          dgViewProjects.ItemsSource = null;
          await LoadTrucks();
      });
      timer.Start();
  }
  </code></pre>