Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一个带有文本的 MessageDialog,必须在计时器 (DispatcherTimer) 上更新。调试器显示,在计时器滴答时分配了 Content 属性,但视觉上没有任何变化。显示新标题有什么棘手的方法吗?
MessageDialog 会阻塞 UI 线程,直到它关闭。因此,在 UI 关闭之前,您无法更改 UI 上的任何内容。唯一可以更新它的,您需要在 DispatchTimer 的滴答事件中定期调用 ShowAsync() 方法。但是,在关闭旧的消息对话框之前,它不起作用。实现这一点的最佳方法是,您应该将自己的消息对话框实现为用户控件。