1
我在我的應用程序啓動一些線程像獲得所有窗口的所有線程
this.Thread = new Thread(() =>
{
System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() =>
{
...
...
}));
System.Windows.Threading.Dispatcher.Run();
}) { IsBackground = true, Name = Constants.SPECIAL_UI_THREAD_NAME};
this.Thread.SetApartmentState(ApartmentState.STA);
this.Thread.CurrentCulture = Thread.CurrentThread.CurrentCulture;
this.Thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
this.Thread.Start();
他們都被生成並顯示一個窗口。 現在,當我在主線程中使用
Application.Current.Windows
我沒有得到我的其他線程的窗口。
如何獲得我的應用程序的所有線程的所有窗口?
由於窗口創建的性能,我需要在其他線程上創建窗口。這一切都很好。現在我有問題從其他線程獲取窗口。 – BennoDual 2012-04-22 10:45:18
@ t.kehl「窗口創建的性能」非常好,而且總是足夠好。也許花費太多時間來獲取數據。然後將其移至一個線程。 – 2012-04-22 16:42:36
@Henk Holterman - 但我的問題不是關於在一個線程中創建窗口 - 這是在這裏工作很好,我不能改變這一點 - 而是我正在尋找一種方式來獲得在不同線程中創建的所有窗口。 – BennoDual 2012-04-23 09:02:00