I’m simply trying to make a button template so I have the same type of button everywhere in my project, so if I change the color it changes every button
The problem is, when I try to make a mouseClicked event on an instance of the template, it doesn’t work because when you click the instance, the event called is the event of the button from inside the template
Every button could do a different action, like system.nav.swapTo or set a tag to a value or set multiple tags to different values, etc.
I would recommend, instead of using a template, is to bind the colors to tags. After you get it the way you want it, you can add it to a custom palette.
With the template I can change everything, color, text, font, size, etc, even change de design
With the palette and binding it would demand a lot of tags
Example has a button with a custom property called ‘style’. Colors are set through the style customizer of the button driven by the ‘style’ custom property. the value of ‘style’ is set via different mouse events of the button. The dataset for the styles is bound to a client tag.