Proper way to add a (routed) event handler to a custom control to make it work in XAML text editor? RRS feed

  • Question

  • What is the proper way to define an event handler?

    This is what I am doing:

    public event RoutedEventHandler Click;

    This works of course, but when I type the property name in the XML attribute - I don't get the dropdown to generate an event handler for it.

    I'm assuming that it is either a current limitation of the editor or that I need to somehow enable it through additional attributes or by defining the event differently...

    Filip Skakun

    Thursday, April 26, 2012 9:06 PM

All replies

  • I'm moving this to the tools forum.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Friday, April 27, 2012 8:35 PM
  • Actually now it works fine even in the XAML text editor. I tried adding another one and it did not work. Neither rebuilding, reopening the solution or reopening the XAML editor helped, but a combination of these + waiting for a while more did help.

    Filip Skakun

    Friday, April 27, 2012 9:29 PM