Kinnara / ModernWpf

Modern styles and controls for your WPF applications
MIT License
4.45k stars 446 forks source link

BasedOn Button Template (New Resource Dictionary) #496

Open Exe-Nihilo opened 2 years ago

Exe-Nihilo commented 2 years ago

I absolutely love this library, but I'm new to WPF, so I would love some help. I'm trying to add a few "BasedOn" Style templates, specifically for buttons. I would like to create a reusable button template called GreenButton where not only is the background green, but it highlight a lighter shade when the mouse is over or when the button is pressed but is also styled the same way as the DefaultButtonStyle or AccentButtonStyle (With the pretty corner rounding).

I have tried several things and can make the background itself change color, but haven't found the right way to go about changing it correctly so that the MouseOver trigger is available to be changed. I believe the issue lies at the line "<local:ContentControlEx". I don't know how to reference this properly.

There is already something similar in ModernWPF.Styles in the buttons for AccentButtonStyle, and I would just like to add another one leaving the original two intact.

Thank you so much in advance.