In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics. We have a border around the entire button xaml and we’d like to use that as the location for updating the background when MouseOver=True in a trigger. What we need to know is how do we update the background of the border in this button with a gradient when the mouse hovers over it?
In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch
Share
In your
ControlTemplate, give theBorderaNameand you can then reference that part of its visual tree in the triggers. Here’s a very brief example of restyling a normalButton:If that doesn’t help, we’ll need to know more, probably seeing your own XAML. Your description doesn’t make it very clear to me what your actual visual tree is.