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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:41:59+00:00 2026-05-13T15:41:59+00:00

Say I have two usercontrols, UC1 and UC2. A user selects something in UC1,

  • 0

Say I have two usercontrols, UC1 and UC2. A user selects something in UC1, which takes some time so the process is threaded off. UC2 needs to update its view and do some work of its own on another thread when UC1 finishes. But UC2 is dependent on the output of the UC1 background thread so it has to wait until that thread is finished before it begins.

UC1 needs to update an ObservableCollection to update its view when its background thread finishes, as does UC1, asynchronously.

Whats the best way to do this? I have tried just threading them off and firing a message from UC1’s thread, but then UC2 cant modify its ObservableCollection because it is not on the right thread- it thinks its on UC1’s thread.

Do I need to marshall the message event from UC1 to UC2, is this safe?

How do people normally handle this?

  • 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-13T15:41:59+00:00Added an answer on May 13, 2026 at 3:41 pm

    Both UserControls should live on the same thread. This is how WPF is designed.

    Since UC2 depends on an event that UC1 also depends on, I would have UC1 scope the lifetime of the event, and send the message to UC2 when the work is done, or else have UC2 subscribe to the ObservableCollection‘s CollectionChanged event. They both live on the same UI thread, so marshalling between them is not needed, you just need to marshal the background thread to the respective UserControl.

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

Sidebar

Related Questions

Say I have two types of objects, Apples and Chainsaws . A user is
Say I have two tables User ----- id first_name last_name User_Prefs ----- user_id pref
Say I have two entities in Doctrine2 that are related to each other, Models\User
Say I have two tables, users and groups each of which has an auto-incrementing
Say I have two divs A and B, which are currently aligned side by
Say I have two large (text) files which are allegedly identical, but I want
Say I have two strings, String s1 = AbBaCca; String s2 = bac; I
Say I have two tables I want to join. Categories: id name ---------- 1
Say I have two lists: var list1 = new int[] {1, 2, 3}; var
Say I have two arrays, items and removeItems and I wanted any values found

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.