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 8429377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:19:11+00:00 2026-06-10T05:19:11+00:00

My app has a background thread that periodically retrieves data from an external source,

  • 0

My app has a background thread that periodically retrieves data from an external source, in the form of key/value pairs. I would like to expose this data for binding, presumably by storing them in some kind of static(?) model, as the data will be needed by numerous views throughout my app. There are potentially hundreds of these keys, and may be different for each customer, so I can’t simply create an INotifyPropertyChanged model with a property for each value.

The app has multiple views visible at any one time, and each of these will have numerous controls (usually textboxes) that I want to bind to individual items in the above collection. When a value in the collection is updated, any controls bound to only that item should change to reflect the new value. I’m assuming an ObservableCollection wouldn’t be suitable here, as a change to a single item will result in all controls updating, regardless of which item they are bound to?

To throw a further complexity into the mix, some values (which are numeric) will need formatting for display, e.g. number of decimal places, or adding a suffix such as “volts”. The formatting rules are user-defined so I can’t hardcode them into (say) the XAML binding’s StringFormat expression. Ideally I should be able to access both the raw value (e.g. for calculations), and the formatted version (for display purposes). I’m sure it must be possible to achieve the latter using some clever WPF feature!

I would appreciate any pointers on how I can solve these requirements.

Edit: it’s worth mentioning that I’ve previously tried implementing the model as some kind of collection. The problem is that it won’t be initially populated with all values, and these only get added some time later. When they do eventually get added, a bound control doesn’t update – presumably because it wasn’t initially able to bind to the missing value.

  • 1 1 Answer
  • 0 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. Editorial Team
    Editorial Team
    2026-06-10T05:19:13+00:00Added an answer on June 10, 2026 at 5:19 am

    ObservableCollection is perfect here. You should find that a standard ItemsControl bound to an ObservableCollection will only update the controls of the items that have changed, not every item in the collection.

    This is the reason ObservableCollection exists – the events that it raises specifically identify items that have changed, so that the UI can handle them sensibly.

    I’ve tested this locally with a small WPF app and it works fine. Worth noting, though, that a virtualised items panel would probbaly appear to break this behaviour when it scrolls…

    EDIT: rereading your question, you actually say “When a value in the collection is updated…” If your collection contains instances of a class, and you update properties on the class, you don’t even need ObservableCollection for this to work – you just need the class to implement INotifyPropertyChanged.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have c# app that has UI and background threads. Based on user input
I'm building an app that pulls data from a remote server and stores them
I'm finding that after my app has been in the background for a while,
We have an Android app that periodically polls for data and updates the display.
I've got an Android app which has a periodic background Service. I want this
My app has an options menu that is available in almost all Activities, which
My app has a UITableViewController that is getting an Invalid Update: invalid number of
Possible Duplicate: I need a good way to get data from a thread to
My app has a ListPreference, whose entries come from a network API. In my
I'm creating an app that has a foreground app (of course) and both a

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.