|
-
October 14th, 2008, 03:28 PM
#1
Decoupling GUI from logic question
I have a simple program that comprises a simple GUI (one form) that has a SerialPort object.
A button on the GUI activates the SerialPort's Send method
An event fired by the serialPort object 'listens' for the reply
// When data is recieved through the port, call this method
SerialPort.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
The port_DataReceived method amongst other things writes the data received to the GUI
Now I want to decouple the GUI from the Logic
If the GUI object creates a Logic object, it can call the Send method no problem.
question is: what is the best way to get the GUI notified that the Logic has received a message given that the Logic doesnt know anything about the GUI?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|