wpf的事件,有没有优先级别设置的?

startququ 2012-04-27 08:24:14
即事件队列里,如果有很多事件,那么,优先处理某些事件,能否做到?
...全文
185 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
nonocast 2012-04-27
  • 打赏
  • 举报
回复
wpf中Dispatcher采用拥有优先级的队列来存储事件,在Invoke和BeginInvoke通过DispatcherPriority来控制优先级
Invalid The enumeration value is -1. This is an invalid priority.
Inactive The enumeration value is 0. Operations are not processed.
SystemIdle The enumeration value is 1. Operations are processed when the system is idle.
ApplicationIdle The enumeration value is 2. Operations are processed when the application is idle.
ContextIdle The enumeration value is 3. Operations are processed after background operations have completed.
Background The enumeration value is 4. Operations are processed after all other non-idle operations are completed.
Input The enumeration value is 5. Operations are processed at the same priority as input.
Loaded The enumeration value is 6. Operations are processed when layout and render has finished but just before items at input priority are serviced. Specifically this is used when raising the Loaded event.
Render The enumeration value is 7. Operations processed at the same priority as rendering.
DataBind The enumeration value is 8. Operations are processed at the same priority as data binding.
Normal The enumeration value is 9. Operations are processed at normal priority. This is the typical application priority.
Send The enumeration value is 10. Operations are processed before other asynchronous operations. This is the highest priority.

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧