Need for multiple button styles #14312
Replies: 8 comments
-
This is what themes are for. There are several available for Avalonia. You can also make your own and reuse it wherever you want. The material theme for example is used in a lot of apps. https://github.com/AvaloniaCommunity/Material.Avalonia Controls in Avalonia are actually "lookless" which means they don't even have a visual representation without a style/theme. Which means they can be customised to look like anything. |
Beta Was this translation helpful? Give feedback.
-
@thevortexcloud Great! Thanks for the response :) |
Beta Was this translation helpful? Give feedback.
-
That's what Dynamic Resources is for. You just have to find out the resource key to use. Check original styles in source for reference |
Beta Was this translation helpful? Give feedback.
-
You can also just set a global style and override really anything if you want. In any case, the themeing system is very flexible. Also since it sounds like you are possibly not aware of it, Avalonia actually has two official themes. The Fluent theme, and the simple theme. They visually look pretty different. I typically use Fluent myself but that's mainly out of habit. |
Beta Was this translation helpful? Give feedback.
-
I understand, so I will act accordingly. Thanks for the replies. |
Beta Was this translation helpful? Give feedback.
-
@SmauDistribution you may also like the theme from Actipro. |
Beta Was this translation helpful? Give feedback.
-
Will convert this into a Q&A as for now. |
Beta Was this translation helpful? Give feedback.
-
found the solution just add -- Classes="accent" -- to the button and it will apply Accent theme to the button |
Beta Was this translation helpful? Give feedback.
-
Hello everyone!
I've been using Avalonia for a short time, and I've relied on https://theme.xaml.live/ to customize the FluentTheme. I need to create an app where a button must stand out from the others, and in this case, I would need a button like the one on FluentEditor called the "Enabled Accent Button," but I haven't found any other variant besides the classic one.
I'm opening this new issue because it would be nice to have more variations beyond the normal button, similar to Bootstrap, or to be able to change the background and automatically generate other colors based on the background for hover or when the button is clicked. I know this can be done with styles, but I think it would be better to have something automatic or predefined instead of having to create a custom button for every project.
Thanks for the work you've been doing so far. Keep it up!
Beta Was this translation helpful? Give feedback.
All reactions