WPF baml bug: EventSetter in static resource being set twice, second time to null
If I try to store a collection of SetterBase objects in xaml, that includes and EventSetter, The xaml loader throws an error. The root cause is that the xaml loader tries to set PresentationFramework.dll!System.Windows.EventSetters.Event twice: the first time to the correct value (ButtonBase.Click RoutedEvent) but the second time to null, and this throws an exception. My attached property callback is not involved. Why does it try to add the event to the EventSetter twice and why is it null the second time? I checked that the ctor being used is the default one so, EventSeetter is not