开发者

Silverlight PRISM, creating a behavior

开发者 https://www.devze.com 2022-12-11 07:55 出处:网络
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

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 stan开发者_运维问答dard silverlight project and based on PRSIM.

Has anyone else had this?

Thanks for your time


PRISM has nothing to here I think. I would suggest that you put debug points in the OnAttached, OnDetached and TextBoxFilterBehaviorKeyDown 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

0

精彩评论

暂无评论...
验证码 换一张
取 消