Search code examples
wpfrouted-events

How can I listen to a RoutedEvent from a class that doesn't derive from FrameworkElement ? Can it be done?


The question says it all basically.

I want in a

class MyClass 

to listen to a routed event. Can it be done ?


Solution

  • Actually I wiredup the event the wrong way :|

    I had

    EventManager.RegisterClassHandler ( typeof ( MyClass )......
    

    Instead of

    EventManager.RegisterClassHandler ( typeof ( TheClassThatOwnedTheEvent )
    

    So .. my bad.