Reputation: 13620
I'm doing all crazy stuff today :D I tried invoking it by
Dispatcher.BeginInvoke(() =>
{
username = UsernameInput.Text;
});
But that does not seem to work :( And how do I also set a value cross thread?
Upvotes: 0
Views: 393
Reputation: 13620
Problem solved by sleeping the thread for a second after Dispather. Guess you have to allow the gui thread to "answer" the other thread.
Upvotes: 0
Reputation: 4098
I did this some time ago, don't know if it's the right way to do it but it works tho:
Invoke((MethodInvoker)delegate
{
// Code...
});
Upvotes: 1