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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:33:08+00:00 2026-05-27T22:33:08+00:00

The setup of the solution is a little bit complicated and restricts my options.

  • 0

The setup of the solution is a little bit complicated and restricts my options.

  1. There is a project that contains all the GUI components; in it resides a control that contains a list of ‘Project’ items that each contains a list of ‘Document’ items. Initially both of these lists were implemented as ObservableCollections.
  2. Project and Document are defined in a separate project, one that does not have access to System.Windows
  3. One of the critical functions of the program generates a Document within a background thread (because it is slow and time-consuming); this Document needs to be added to a Project’s Documents collection.

Since the document is being generated in a background thread, that thread cannot add the document to the collection – a NotSupportedException is generated.

There are several ways to extend ObservableCollections to be thread-safe – unfortunately all of the ones that I have seen so far rely on System.Windows.Threading.Dispatcher, which I cannot use due to (2).

I have discovered that I cannot use INotifyPropertyChanged on a list and must use a collection implementing INotifyCollectionChanged – basically ObservableCollection again. I’m not sure if it’s a good idea to implement an extension of a List object when there are so many different methods that modify it, and what’s to say it wouldn’t have the same issues as ObservableCollection?

Using an explicit UpdateSourceTrigger on the binding does not look feasible, given that the Document is in a HierarchicalDataTemplate, and in any case passing the binding to the Project object looks to be a bit ugly.

Any suggestions?

  • 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-05-27T22:33:09+00:00Added an answer on May 27, 2026 at 10:33 pm

    Create the document on the background thread but use a callback on the primary thread to add it to the ObservableCollection (assuming the ObservableCollection is created on the primary thread).

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

Sidebar

Related Questions

This is my project setup: In visual studio I have a solution with a
If I have a setup project in a VS 2010 solution and I add/remove
I have an MVVM setup with a mainwindow that contains a ContentControl. I set
I'm trying to find some information on preferred solution setup when using MVC 2
My VS2008 solution has the following setup. Program1 Program2 Common.dll (used and referenced by
When using ASP.net webforms my usual solution would have following type of setup -
Let's say we are building some public service that grabs the setup of a
I am running a little program in python that launches a small window that
I'm working on a little html/css framework that I can use for most of
I have a object graph that is setup like this Clients string Name List[Address]

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.