Try to invoke your code from the dispatcher:
Application.Current.Dispatcher.Invoke((Action)delegate{
// your code
});
Try to invoke your code from the dispatcher:
Application.Current.Dispatcher.Invoke((Action)delegate{
// your code
});