Replies: 3 comments 7 replies
-
If you set global textblock style, you can also set global button style template-binding to the local button.fontsize value |
Beta Was this translation helpful? Give feedback.
0 replies
-
Surprisingly I set my global button style to Textblock.FontSize = {Templatebinding FontSize} & it didn't work. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Basically reason of this behavior is simple after knowing how style system works + knowing that Avalonia has inherited properties. How font size is resolved going by priority from lowest:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
Currently when defining a global deafult TextBlock style for FontSize, Button's which implement a fontsize are not able to overwrite the internal textblock's fontsize due to the style. Removing the FontSize global style fixes this currently. I believe this will be useful for projects which implement a default style theme like in my case where we have a default textblock size.
Describe the solution you'd like
Make the fontsize of the Button's Textblock always depend on the Button font size instead of the TextBlock font size.
Describe alternatives you've considered
Overwriting the content presenter style of our buttons to make this work or disabling a global font size theme.
Additional context
This was discussed in Issue #4353 and I left a comment there
Beta Was this translation helpful? Give feedback.
All reactions