"calling thread must be STA" error when trying to access an object from another window
I have an application that does data acquisition over a serial port (modbus), and I us开发者_如何学Goe a BackgroundWorker object to call the device because otherwise it takes time and freezes my UI. The problem arises when I open a new WPF window and set its DataContext to be the object I'm updating (I want to use this window to get a detailed view of the device - status, charts, bargraphs). Is there a way of using my data object in another window or should I consider making my app a single windowed one? Thank you
Try checking out the discussion on a similar question that I asked. I think it might help you out. STAThread missing but it is there. I know the title seems a little different, but a lot of the ideas presented might help you out as well.
精彩评论