How to add text to richtextbox from different thread with wcf?
-
I haven't found a solution for this yet, probably a lack of Google skills, but how can I update the contents in a richtextbox in wpf from a different thread? There is not Invoke or BeginInvoke on the control so delegates won't work? And using a delegate in this way: this.Dispatcher.Invoke(DispatcherPriority.Normal, new AddTextDelegate(_AppendtextLine), null, new object[] { text }); only makes the application hang. Any good ideas on this?
-
I haven't found a solution for this yet, probably a lack of Google skills, but how can I update the contents in a richtextbox in wpf from a different thread? There is not Invoke or BeginInvoke on the control so delegates won't work? And using a delegate in this way: this.Dispatcher.Invoke(DispatcherPriority.Normal, new AddTextDelegate(_AppendtextLine), null, new object[] { text }); only makes the application hang. Any good ideas on this?
Hello Daniel, Check this out: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[BackgroundWorker] The BackgroundWorker enables you to stop the current Thread, and report the status. Hope this helps!
-
Hello Daniel, Check this out: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[BackgroundWorker] The BackgroundWorker enables you to stop the current Thread, and report the status. Hope this helps!
Unfortunately, that won't help. Since i'm already on another thread when recieving the event, that's nothing I can control. The problem is access to the controls on the main thread when an event is recieved.