2011-11-22 164 views
2

我正在C#中使用Silverlight爲Windows Phone 7創建應用程序。我發現許多DispatcherTimer(DispatcherPriority)重載的引用,但我不能在我的代碼中設置它(例如timer = new DispatcherTimer(DispatcherPriority)告訴我「DispatcherPriority在當前上下文中不存在」)。如何設置DispatcherTimer的優先級?

我認爲DispatcherTimer被DispatcherTimer(DispatcherPriority)重載,但是當我在代碼中使用它時,我看不到任何對此構造函數的引用。我想嘗試將優先級設置爲「正常」或「發送」,但似乎無法實現具有優先級的任何DispatcherTimer。有什麼建議麼?

回答

5

採用分派器優先級的構造函數僅存在於完整的.NET框架中 - 即WPF。 Silverlight/WP7中的DispatcherTimer不支持priorty。

比較DispatcherTimer中的文檔。 NET 4Silverlight

+0

這就是我所懷疑的。感謝你的回答!! – user1030679