I am using signalR to push messages up to server and down to specific clients.
When I send a message, the receiving client is sent a ReceiveMessage function call from my signalR server, which maps to a static class function in my app. The static class then tries to do new Chat()
(my messaging window class) to open a message window on the receiving side.
This throws calling thread must be STA, because many UI components require this.
I have worked with delegates before on simple form elements (like changing a textbox), but I don't understand how to apply that in this situation. When I read about Invoke
, it is called on a form object of some sort, which does not exist in my situation?
TLDR; how do I create and show a new instance of a form from a static class function call