【问题标题】:How can I set the priority of a DispatcherTimer?如何设置 DispatcherTimer 的优先级?
【发布时间】:2011-11-22 04:03:41
【问题描述】:

我正在使用 C# 中的 Silverlight 创建适用于 Windows Phone 7 的应用程序。

我发现许多对 DispatcherTimer(DispatcherPriority) 重载的引用,但我无法在我的代码中设置它(例如 timer = new DispatcherTimer(DispatcherPriority) 告诉我“DispatcherPriority 在当前上下文中不存在”)。

我认为 DispatcherTimer 被 DispatcherTimer(DispatcherPriority) 重载,但是当我在代码中使用它时,我看不到对这个构造函数的任何引用。我想尝试将优先级设置为“正常”或“发送”,但我似乎无法实现任何具有优先级的 DispatcherTimer。有什么建议吗?

【问题讨论】:

    标签: windows windows-phone-7 dispatchertimer


    【解决方案1】:

    采用 Dispatcher Priority 的构造函数仅存在于完整的 .NET 框架中——即用于 WPF。 Silverlight/WP7 中的 DispatcherTimer 不支持优先级。

    比较 .NET 4Silverlight 中 DispatcherTimer 的文档。

    【讨论】:

    • 这就是我的怀疑。谢谢你的回答!!
    猜你喜欢
    • 1970-01-01
    • 2011-05-09
    • 1970-01-01
    • 2017-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多