title: What is a good way to display dynamic data in WPF?
body: <p>I am struggling with the best way to handle a WPF application that has dynamic data updates. Should I use the rich data binding provided by WPF or not? </p>
  
  <p>I will simplify my problem domain as much as possible in the discussion below, and briefly mention some solutions. I am very interested in whatever comments this community can provide.</p>
  
  <p><strong>Simplified Problem Domain</strong>:
  Suppose you have a system with about 1,000 items, each with a unique “<em>name</em>”, and a dynamic “<em>speed</em>” and “<em>location</em>”. The data for these items is updated 60x per second. You wish to display this data to the user in a variety of UI’s – everything from “labels displaying numbers” to graphical dials/meters/gauges/etc. Perfect job for WPF – separate the visuals from the rest of the application. How would you design this system?</p>
  
  <p><strong>My first solution</strong>:
  My first solution was to define an object with speed and location properties (doubles) called “<em>DataItem</em>”, define an interface with a <em>name</em> property (string). Controls that display the data would have to implement the name interface, A “DataManager” was created that scanned for FrameworkElements that implemented the interface, built a list a name/FrameworkElements pairs at initialization time. Then, 60 times per second, the list of 1,000 DataItems was updated, and the DataContext of each matching FrameworkElement was set to the DataItem object. This worked, performance was acceptable (particularly if data was not always changing).</p>
  
  <p>My second solution addressed the problem that the UI Controls in the first solution all had to implement some interface – yuk. I want to use out-of-the-box-unmodified WPF controls (in some cases). So, the second solution was to define an “Attached property” (I put it on the DataManager object), so you could – in xaml – do stuff like </p>
  
  <pre><code>&lt;Label DataManager.Name = "objectname"  Content="{Binding}" /&gt;
  </code></pre>
  
  <p>Somehow, this solution still does not seem right. My third solution was to look into implementing a custom DataSourceProvider. I was not successful. I could not get my head around the data source provider model, and how it would be used in this case.</p>
  
  <p>Right now, I am looking at the CodePlex “dynamic data display” project posted by Microsoft Research. That project is all about plotting/graphing dynamic data, but there could be some ideas there. So here I am on StackOverflow – normally a place with short questions and quick answers. :-)</p>
  
  <p>I am very new to WPF and would appreciate any thoughts anyone has on these issues. Please keep in mind that the problem domain specified here is simplified, so I need a robust solution. There are actually many different types of data objects, each with different properties; and data updates are not the same rate for each object, and the UI controls display single items and groups of items, the data comes in from many sources, etc.</p>