I have a WPF application which has a module for weighing loads. Since the serial port communication varies from one weighbridge to the other, I want to make the weighing module a separate dll. 

I am creating a class library where I use the serial port for weighing loads. I need to return back the weight to the main program. 

```
double GetWeights()
{

 spWeigh = new SerialPort("COM1", 2400, Parity.None, 8, StopBits.One);
            spWeigh.RtsEnable = false;
            spWeigh.DtrEnable = false;
            spWeigh.Handshake = Handshake.None;
            spWeigh.ReadTimeout = 10000;
            spWeigh.DataReceived +=spWeigh_DataReceived;

}

```

But the data receieved is in a different thread. How will I get the weight back in my main program?

```
 void spWeigh_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
      // code here
    }

```