0 votes
16 views
I have a scenario. (Windows Forms, C#, .NET)

There is a main form which hosts some user control.

The user control does some heavy data operation, such that if I directly call the UserControl_Load method the UI become nonresponsive for the duration for load method execution.

To overcome this I load data on different thread (trying to change existing code as little as I can)

I used a background worker thread which will be loading the data and when done will notify the application that it has done its work.

Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl.

The pseudocode would look like this:

Please log in or register to answer this question.

...