我目前遇到了讓Windows Phone應用程序執行跨線程操作的問題。
在錯誤的C#[Windows窗體應用程序]中,有一個選項/變量名爲「CheckForIllegalCrossThreads」 - 如果將此變量屬性設置爲「False」,則應用程序不再檢查運行時操作期間的非法交叉線程。
實際問題:該變量是否在Silverlight Windows Phone應用程序項目中以另一個名稱存在?CheckForIllegalCrossThreads,Thread&Delegate - Window Mobile
更新:[問題解決了,感謝喬恩斯基特]
對於其他人,他們在尋找一種方式來解決這個問題,或者simmilar問題:我解決本次發行採用[上述]「調度.BeginInvoke」Thread myThread;
public MainPage()
{
InitializeComponent();
myThread = new Thread(ThreadPromt);
myThread.Start();
}
Private void ThreadPromt()
{
Dispatcher.BeginInvoke(deleage(
MessageBox.Show(string.Format("Accessed from another thread: {0}", SampleLabel.Text);
ButtonSample.Text = "Accessed from another thread...";
);
}