Replies: 2 comments 8 replies
-
|
I see how it can be useful and agree that we should have it. Since we're following CSS-like selectors and styles, it might make sense to port CSS "all" property, see So I would imagine something like <Style Selector="Button.with-all-unset">
<SetterAll Value="Unset" />
<Setter Property="Foreground" Value="Blue" />
<Setter Property="Template" Value="{StaticResource CustomButtonTemplate}" />
</Style>But it's only my thoughts. @AvaloniaUI/core |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, a change like this would need a lot of discussion I think. We already have plans in place to address the issue that you were experiencing (#2769) I think but that's a longer-term project that is going to need proper support from the XAML compiler.
As Max said, unfortunately temporary fixes aren't really acceptable at this point in the project. Once people start using it, it's going to be very difficult to remove because people will start depending on it. However... I think your solution could be implemented without making any changes to Avalonia if you're sure that this is what you want and you don't want to wait for us. If I get a bit of time, I can try to put together a solution. Basically, we allow you to override the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please, review the following pull request #6168
Here is an example of having two buttons without styles with one button containing a FluentTheme button style. The trick is to add a Styles to CanceledStyles property of a Visual element to cancel all the styles with that selector defined above in the logical tree:
And here is how it looks:
the retemplated buttons do not have any styles from the top, so they do not shrink when clicked.
Beta Was this translation helpful? Give feedback.
All reactions