Has anyone else had issues when printing a xamDataGrid and trying to show progress bar whilst exporting / printing / previewing on separate thread? Im getting the thread exception error (Exception has been thrown by the target of an invocation.) (The calling thread cannot access this object because a different thread owns it.)
Thanks
You need to get yourself back into the UI thread before showing the window... here is some code to do that:
private delegate void DelegateLaunch();private void LaunchWindowInUIThread(){ if (_myWindow != null && _myWindow.Dispatcher.Thread != Thread.CurrentThread) { _myWindow.Dispatcher.BeginInvoke(new DelegateLaunch(LaunchWindow)); } else { LaunchWindow(); } }private void LaunchWindow(){ _myWindow.ShowDialog();}