Silverlight PRISM,创造一种行为
我一直在尝试在基于 PRISM 的 silverlight 项目中创建基本行为。类似于 http://csharperimage.jeremylikness.com/2009/ 10/silverlight-behaviors-and-triggers_09.html
我遇到的问题是行为的 OnAttached() 和 OnDetaching() 方法被调用得很好,但是当我设置事件处理程序时,例如 AssociatedObject.KeyDown += _TextBoxFilterBehaviorKeyDown;
关联的方法永远不会被调用。我认为这可能与它不是标准的 silverlight 项目并且基于 PRSIM 有关。
还有其他人有过这个吗?
感谢您抽出时间
I've been trying to create a basic behavior in my PRISM based silverlight project. Something like http://csharperimage.jeremylikness.com/2009/10/silverlight-behaviors-and-triggers_09.html
the problem I am having is that the OnAttached() and OnDetaching() methods of the behavior get called fine but when I set up my event handler for example AssociatedObject.KeyDown += _TextBoxFilterBehaviorKeyDown;
The associated method will never get called. I figured it may have something to do with it not being a standard silverlight project and based on PRSIM.
Has anyone else had this?
Thanks for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 PRISM 在这里没什么用处。我建议您将调试点放在
OnAttached
、OnDetached
和TextBoxFilterBehaviorKeyDown
方法中,以便检查是否有效地调用了所有代码在适当的时间。顺便说一句,您提供的链接不起作用,但也许此链接中的信息对您有帮助: http://www.nikhilk.net/Silverlight-Behaviors.aspx
PRISM has nothing to here I think. I would suggest that you put debug points in the
OnAttached
,OnDetached
andTextBoxFilterBehaviorKeyDown
methods, in order to check that effectively all the code is being invoked at the appropriate time.By the way the link you have provided is not working, but maybe the information in this one helps you: http://www.nikhilk.net/Silverlight-Behaviors.aspx