-
Beta Was this translation helpful? Give feedback.
Answered by
tznind
Dec 5, 2023
Replies: 1 comment 3 replies
-
When you access UI code from a thread make sure to use For example Application.Init ();
Task.Run (() => {
// Runs on another Thread
Task.Delay (5000).Wait ();
// Invoke the action onto main UI thread
Application.MainLoop.Invoke (() => {
// Your UI code here
MessageBox.Query ("Heya", "Hey", "ok");
});
});
Application.Run (new Window("yar"));
Application.Shutdown (); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
dkim-epic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you access UI code from a thread make sure to use
Application.MainLoop.Invoke
For example