var t = new Thread(new ParameterizedThreadStart(DoWork));
t.SetApartmentState(ApartmentState.STA);
t.IsBackground = true;
t.Start(App.Current.MainWindow);
public static void DoWork(object owner)
{
var progressDlg = new ProgressBarDialog();
// progressDlg.Owner = (Window)owner; // This doesn't work
progressDlg.ShowDialog();
}
Now, tell me please is it possible to make it work?
App.Current.MainWindow in the example not accessible from another thread.
And also I've heard about new cool way of Parallel.Invoke() but I don't know is that applicable for this situation or not. I appreciate if you show me how it works.