the current thread cannot code example Example: the current thread cannot this.Dispatcher.Invoke(() => { ...// your code here. });