0

在 WPF 中更新 UI 可以通过调用BeginInvoke或类的Invoke方法来完成Dispatcher。通常每个人都使用这种技术来更新可能适合用户需求的 UI。但是我找到了一个DispatcherFrame在框架中调用的类来做同样的事情。

DispatcherFrame frame = new DispatcherFrame();   
//Dispatcher.BeginInvoke code comes here
Dispatcher.PushFrame(frame);

上什么DispatcherFrame课多Dispatcher?我们什么时候可以去DispatcherFrame?非常感谢您的回答。

4

1 回答 1

-1

Another question that could have been solved just by googing keyword DispatcherFrame.

Dispatcher creates automatically DispatcherFrames and places them inside a queue. Window itself is a large DispatcherFrame for example.

Only reason why you would use it is if you wish to configure your frame e.g. with some callbacks when Dispatcher is done with all the actions inside it.

于 2013-10-07T07:22:04.810 回答