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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:40:06+00:00 2026-06-12T23:40:06+00:00

The main reason I started with WPF in the first place was the promise

  • 0

The main reason I started with WPF in the first place was the promise of all the awesome possibilities of databinding. After days of headaches I’m beginning to think that one of the most common scenarios is impossible, and I’d love to be proved wrong! 🙂

  • I have a ListBox that will have instances of my custom class as its ListItems.
  • My class is DataBinding-ready by implementing some DependencyProperties.
  • My ListBox has a custom DataTemplate to display these properties in a nice layout.
  • ListBox has the ItemsSource set to an ObservableCollection<MyClass>
  • The listbox may need to display hundreds, even thousands of items so in order to maintain a responsive UI, they need to be instantiated in the background.

Turns out it’s impossible to create instances of my class in a background thread and add them to the ObservableCollection (or directly to the listbox, when we omit the ItemsSource) in the UI thread, as long as they are DependencyObjects. It throws an exception saying

Must create DependencySource on same Thread as the DependencyObject

How am I supposed to handle a scenario like this in WPF? Don’t use DPs at all and go with INotifyPropertyChanged? What people actually do, when they need to do this? I think this is a fairly common scenario and I’m quite upset how most DataBinding related articles ramble about the possibility to change a TextBox background color if you type in “Magenta”… 🙂

  • 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-12T23:40:07+00:00Added an answer on June 12, 2026 at 11:40 pm

    You can use INotifyPropertyChanged instead (as I have recommended), or you could make your objects Freezable and freeze them after creation, or you could break down the creation of your objects into distinct steps or groups and do each step in a separate dispatcher message. For example, create your objects in groups of 10 and do each in its own, lower priority dispatcher message.

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

Sidebar

Related Questions

SoundManager2 seems awesome, but the main reason I'm looking to use something other than
Recently I hear Steve Jobs citing this as a main reason to not have
I decided to learn Assembly language. The main reason to do so is being
For some reason, my method bishops runs much faster when called from the main
Is there any reason why this shouldn't work? [PseudoCode] main() { for (int i
After upgrading from Visual Studio 2010 to 2012 code started throwing ArgumentOutOfRangeException - Index
I recently got started trying to use SFML. For some reason my simple program
I recently got started trying to use SFML. For some reason my simple program
I'm trying to get started with Hibernate, but can't insert data, for some reason.
I've started a template on a page and for some reason one of my

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.