Hello,
I’m using DevExpress to create a ribbon bar menu and multiple palettes are supposed to be included in it. In order to generate the palettes dynamically I’m creating a BarButtonItem in the codebehind and read a template from a xaml string that includes the palette. As it doesn’t work to include event bindings in the xaml string itself and as the DevExpress BarButtonItem is not a UIElement so I can’t use VisualTreeHelper to get hands on anything in the template to bind events to I’m using a custom behavior to add nodes to the palette dynamically.
This custom behavior is attached to the palette and in the OnAttached() function I’m adding an event handler to the TemplateApplied event so after the template is applied to the diagram I can dynamically add my nodes to the palette’s NodesSource. So far, it’s working fine. However, I need to mimic a ribbon bar gallery with the palette and thus need to add hover effects to my added nodes. I tried to add an event handler for the NodeCreated event in which I finally add event handlers for the nodes MouseEnter and MouseLeave events but contrary to the TemplateApplied one the NodeCreated event handler is never being called. What event do I have to catch to get my hands on the node that is added to the palette?