Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void UpdateStatus()
- {
- this.Dispatcher.BeginInvoke( delegate { StatusLabel.Text = "Updated"; });
- }
- private void UpdateStatus()
- {
- // check if we not in main thread
- if(!this.Dispatcher.CheckAccess())
- {
- // call same method in main thread
- this.Dispatcher.BeginInvoke( UpdateStatus );
- return;
- }
- // in main thread now
- StatusLabel.Text = "Updated";
- }
Add Comment
Please, Sign In to add comment