Silverlight 路由事件和异常
我有一个复杂的应用程序,它由一个应用程序组成,其中包含许多模块,每个模块都包含许多视图。 我的观点的行为可能会引发异常。
有时我想在创建它们的视图上处理异常,有时在父模块中,有时在祖父应用程序中。
RoutedEvents 的概念似乎是解决这个问题的明智方法,但我不完全确定如何解决这个问题。
有谁可以分享任何示例或链接来证明我想要实现的目标吗?
谢谢 标记
I have a complex application that consists of an Application, containing many modules, each containing many views. The behaviours of my views may throw exceptions.
Sometimes I want to handle exceptions on the view that created them, sometimes in the parent module, sometimes in the grand-parent application.
The concept of RoutedEvents seems like a sensible way of approaching this problem, but I'm not entirely sure how to go about that.
Does anyone have any examples or links they can share that demonstrate what I am trying to acheive?
Thanks
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尽管 Silverlight 包含 RoutedEventHandler 和 RoutedEventArgs,但不幸的是,桌面 WPF 框架中的“路由事件”概念与此不同。
今天保留它是为了源代码和 API 兼容性,将来也许可以支持它。
这意味着,与此同时,您可能能够做一些额外的工作,并且仍然可以通过
如果您需要有关如何进行此操作的更多信息,请告诉我。 了解您的“模块”是如何构建或设计的将有所帮助。
Although Silverlight contains the RoutedEventHandler and RoutedEventArgs, unfortunately the concept of "routed events" as seen in the desktop WPF framework is not the same.
Today it's kept for source and API compatibility, and in the future, maybe it could be supported.
What this means is that, in the meantime, you may be able to do a little extra work and still accomplish this by
Let me know if you need more information on how to go about this. It would help to know how your "modules" are constructed or designed.
您可能对此感兴趣:
“Silverlight 3 的 RoutedEvents 实现,包括 WPF 兼容性”
http://sl3routedevents.codeplex.com/
This might be interesting for you:
"RoutedEvents implementation for Silverlight 3 including WPF compatibility"
http://sl3routedevents.codeplex.com/