Closed steventhorne closed 9 years ago
This sounds like an issue with WPF to me, could you provide some test code so I can have a better understanding of the issue?
I know in WinForms you have to be on the graphics thread to adjust any values of a control, maybe that applies here as well?
I'm instantiating this class in the MainWindow constructor which is the xaml.cs class.
I've also tried using JSON.net to deserialize json in an OnMessageReceived event and that gives me the same exception.
Ok so you were right about the graphics thread. I used the Dispatcher.Invoke of m_MainWindow to change the ui and there are no more issues, but I am still curious about why I couldn't do the JSON.net stuff, I'm going to attempt it again.
Has this issue been resolved then?
I would say so, sorry about causing a ruckus and thanks for the help!
Not a problem, glad I could help. :)
I subscribe to the OnMessageReceived event in SlackSocketClient. I'm using wpf and I'm trying to set the text of the TextBlock when I get a new message, but if I set the text in the function that is attached to the OnMessageReceived event it gives me a TargetInvocationException.