Silverlight PRISM, creating a behavior
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
精彩评论