在完全呈现哪个事件之后打印wpf窗口?

时间:2011-01-19 07:24:00

标签: c# .net wpf

如何在完全呈现哪个事件后打印wpf窗口?

我已尝试使用已加载但部分元素尚未完成呈现

感谢

2 个答案:

答案 0 :(得分:1)

Read this article它向您显示目前没有正式的方式获得渲染结束的通知,而是向您展示了一个可以使用的技巧。

答案 1 :(得分:1)

我没有适合您的解决方案,但您可以在已加载的事件中进行以下操作:

Dispatcher.BeginInvoke(new Action(delegate {      
        // here you are pretty shure that all rendering is done                
        // Put in your code here
        }), System.Windows.Threading.DispatcherPriority.ContextIdle, null); 

可能它也适用于DispatcherPriority.Background,请查看。

相关问题