我不明白为什么在 WPF 架构中 UI 和渲染线程之间有两种通信方式??。
UI 线程将视觉合成数据传输到渲染线程以在 UI 上渲染。但是为什么以及什么数据从渲染线程传输到 UI。
甚至我想知道 WPF 中如何处理用户交互。
我能否获得良好的链接,以便我阅读或理解 WPF 中的 UI 交互处理? WPF 中如何处理 UI 上的用户交互。
最佳答案
A Dispatcher负责管理线程的工作。
UI线程是渲染UI的线程。
UI 线程在称为 Dispatcher 的对象中对工作项进行排队。调度员按优先级选择工作项并运行每个工作项直至完成。每个 UI 线程必须至少有一个 Dispatcher,并且每个 Dispatcher 只能在一个线程中执行工作项。
From this article. Read it for a more thorough description of the UI Rendering in WPF
关于c# - WPF : why two way communication between UI and Rendering thread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22626123/