当前位置:网站首页>UWP Dispatcher用法
UWP Dispatcher用法
2022-06-21 20:41:00 【zLulus】
Task.Run(async () =>
{
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
ContentDialog dialog = new ContentDialog()
{
Title = "Test Dispatcher(测试Dispatcher)",
DefaultButton = ContentDialogButton.Close,
CloseButtonText = "Close(关闭)"
};
await dialog.ShowAsync();
});
});
根据CoreDispatcherPriority Enum,优先级分为:High:高优先级。 所有同步请求都会立即调用委托。 异步请求在任何其他请求类型之前排队和处理。
不要在应用程序中使用此优先级。 它是为系统事件保留的。 使用此优先级可能会导致其他消息(包括系统事件)被延迟。Normal:正常优先。 事件按安排的顺序进行处理。Low:低优先级。 如果队列中没有更高优先级的事件,则处理该事件。Idle:最低优先级。 将此优先级用于后台任务。 当窗口的主线程空闲并且队列中没有待处理的输入时,会处理委托。
示例代码
参考资料
CoreDispatcher Class
CoreDispatcher.RunAsync
CoreDispatcherPriority Enum
Getting the Dispatcher of a Window in UWP
边栏推荐
- Qt滚动区域QScrollArea
- 浅学Vector---如何使用常见的接口
- Luogu p5440 [XR-2] miracle solution
- Technology sharing | a clustering incremental statistical SQL requirement in MySQL
- 关于eureka启动成功但是访问404问题
- 软件架构介绍
- Notes on topic brushing (16) -- binary tree: modification and construction
- nuxt ssr打包和部署
- 利用do while循环,分别计算1-100中奇数的和、偶数的和【方法一】
- 利用for循环,分别计算1-100中奇数的和、偶数的和【方法一】
猜你喜欢

刷题笔记(十七)--二叉搜索树:关于属性问题

Dragon lizard community established cloud native SIG and introduced three core technologies

Zhengweimin, academician of the Chinese Academy of Engineering: I am optimistic that China will have a place in the next it Era

力扣刷题集结4(mysql版本)
![class path resource [classpath*:mapper/*.xml] cannot be opened because it does not exist](/img/1a/294eb0128285686ede415991f69be7.png)
class path resource [classpath*:mapper/*.xml] cannot be opened because it does not exist

Technology sharing | a clustering incremental statistical SQL requirement in MySQL

【深入理解TcaplusDB技术】一键安装Tmonitor后台

Lifting method (I) AdaBoost
![[deeply understand tcapulusdb technology] table management of document acceptance](/img/59/e435623ab9cc7d2aa164c2f08e135f.png)
[deeply understand tcapulusdb technology] table management of document acceptance

力扣刷題集結4(mysql版本)
随机推荐
利用do while循环,分别计算1-100中奇数的和、偶数的和【方法一】
Summary of Li Kou brush questions 4 (MySQL version)
技术分享 | MySQL中一个聚类增量统计 SQL 的需求
Introduction to software architecture
nuxt ssr打包和部署
cpu指令重排导致错误的一个例子
Lifting method (Part 2) lifting tree
关于eureka启动成功但是访问404问题
力扣刷題集結4(mysql版本)
Use the do while loop to calculate the odd and even sums in 1-100 [method 2]
【深入理解TcaplusDB技术】一键安装Tmonitor后台
class path resource [classpath*:mapper/*.xml] cannot be opened because it does not exist
Pycharm使用指南
GDB debugging skills (0) getting started with GDB
fork-join线程池
Is it OK for Zhongyan futures to open an account? Is the platform reliable? Is it safe?
电脑屏幕分辨率怎么调?电脑屏幕修改分辨率SwitchResX
Use the for loop to calculate n! Value of
UEFI 双系统+双硬盘安装
技术分享 | kubernetes pod 简介