Uno.Themes
Uno.Themes copied to clipboard
Allow overriding of resources within a control's template (Lightweight Styling)
There are currently many areas in Material and Cupertino that are hardcoding references to specific brush resources within the template of the control.
Example: The Disabled VisualState for TextBox forces the Border.Fill and PlaceholderElement.Foreground to specific brush resources. This is limiting the amount of customization that client apps should have over the default Material/Cupertino styles.
One idea would be to follow Microsoft's path for Lightweight Styling. This is already being done for certain styles, like here for the V2 FAB styles.
Another approach would be to take advantage of TemplateSettings classes, which @Xiaoy312 can explain further.
We are probably not going to take that 2nd approach for 2 reasons:
- "TemplateSettings classes provide a set of properties that are used when you define a new control template for a control."
- "they are calculated values coming from the basic control logic"
While 1 can be bypassed with attached property and there is counter-example for 2, it doesnt make them easily accessible for dev to alter them.
Closing this as it is now being planned/tracked here: https://github.com/unoplatform/Uno.Themes/issues/854