有没有办法看WPF路由事件? [英] Is there a way to watch WPF Routed Events?

查看:287
本文介绍了有没有办法看WPF路由事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法观看WPF应用程序中引发的所有RoutedEvents。写一些关于控制台触发的事件的信息将会是完美的,看看发生了什么。

I was wondering if there's a way to watch all RoutedEvents that are raised in a WPF application. A way to write some info about the events fired to the console would be prefect to see what's going on.

推荐答案

是的,但是它需要一些反思。您最好使用 Snoop 这样的工具,这已经为您提供了很大的帮助。

Yes, but it requires some reflection. You're better off using a tool like Snoop that already does the hard lifting for you.

在选项卡事件中,您可以看到事件列表和处理它的元素。

In the tab Events you can see list of events, and the element that handled it.

这篇关于有没有办法看WPF路由事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆