Subject: C# GUI Seperation
Posted By: lesliev Post Date: 9/17/2006 3:03:01 PM
Hi!

I have been using C# for a while and am having trouble coming up with a good model for GUI interaction. In most programs I write I need to spawn new threads because I find that networking code is unrealiable otherwise. Those threads need to check InvokeRequired and Invoke controls to do their updating in their own time. This is extremely cumbersome for each control that needs updating! I don't want to use a BackgroundWorker because I don't have one or two long-running processes - I want my whole backend running in it's own thread.

What I end up doing now mostly is having a global (static) object where I mirror data presented on the GUI. The GUI runs a timer and copies that data to the controls. The backend objects update the static object. This seems like an easy way to do things but it's not nice to have global data, and the duplication of data between the GUI and the static object also does not feel right.

Can anyone comment on the best way to run a rich GUI, with everything else on another thread, and the communication between the two?

Leslie Viljoen

 



Go to topic 49870

Return to index page 173
Return to index page 172
Return to index page 171
Return to index page 170
Return to index page 169
Return to index page 168
Return to index page 167
Return to index page 166
Return to index page 165
Return to index page 164