I spent hours searching for a solution to this, but did not find a proper one.
As stated in this post
here, there seems to be a difference in how attached events are registered in XAML and in C#.
As described in the MSDN
documentation , WPF requires you to implement two methods (AddXYZHandler, RemoveXYZHandler) in order to use an attached Event (XYZEvent) in XAML:
public static readonly RoutedEvent XYZEvent = EventManager.RegisterRoutedEvent("XYZ", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(XYZClass));
public static void AddXYZHandler(DependencyObject d, RoutedEventHandler handler)
//event registration comes here
public static void RemoveXY
View Complete Post