I am writing my Bot for Twitch and i am using library called TwichLib (https://github.com/swiftyspiffy/TwitchLib) now in example which is made for WinForms there is method called globalChatMessageReceived
and there is CheckForIllegalCrossThreadCalls = false;
. So whole method looks like
private void globalChatMessageReceived(object sender, TwitchChatClient.OnMessageReceivedArgs e)
{
//Don't do this in production
CheckForIllegalCrossThreadCalls = false;
richTextBox1.Text = String.Format("#{0} {1}[isSub: {2}]: {3}", e.ChatMessage.Channel, e.ChatMessage.DisplayName, e.ChatMessage.Subscriber, e.ChatMessage.Message) +
"\n" + richTextBox1.Text;
}
Now in WPF you are already unable to do this CheckForIllegalCrossThreadCalls so can someone point me on how should i properly do this method to solve this CrossThreadCalls?