Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 86535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:15:41+00:00 2026-05-10T22:15:41+00:00

I am struggling with the best way to handle a WPF application that has

  • 0

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?

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.

Simplified Problem Domain: Suppose you have a system with about 1,000 items, each with a unique “name”, and a dynamic “speed” and “location”. 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?

My first solution: My first solution was to define an object with speed and location properties (doubles) called “DataItem”, define an interface with a name 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).

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

<Label DataManager.Name = 'objectname'  Content='{Binding}' /> 

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.

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. 🙂

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.

  • 1 1 Answer
  • 4 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:15:41+00:00Added an answer on May 10, 2026 at 10:15 pm

    You’re almost there. You want to data bind at two levels.

    First – have your DataItems implement INotifyPropertyChanged or have them derive from DispatchingObject and implement dependency properties for each of the values you want to bind to

    Second – keep all of your DataItems in one of ObservableCollection<DataItem> or a DataTable. You need a collection that supports INotifyCollectionChanged or IBindingList.

    Third – use some kind of container control (listbox, 3rd pary grid control, etc) to bind the list of DataItems to your app

    Fourth – Define a DataTemplate to give each of the DataItems a visual look

    Fifth – if needed, use a DataTemplateSelector to dynamically choose the DataTemplate for different kinds of DataItems

    Here’s a minimal bit of xaml to get you started

    <ListBox ItemsSource='{Binding ...}' ItemTemplateSelector='{StaticResource DTSelector}'> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been struggling with the best way to make sure that the certain
I'm struggling to find the best way to implement my update to the database
Really like objectify, although still struggling with what is the best way to structure
Struggling trying to find best way to reverse a GUID to username. Any help?
I'm struggling to find the best way to do this. Basically I am provided
I love KnockoutJS but have been struggling to figure out the best way to
I'm struggling a bit on the best way to do this with as little
I'm trying to figure out the best way to handle a php project going
I'm new to shared_ptrs and have been struggling with the right way to handle
I am struggling with the best way to report errors in a set of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.