Replies: 3 comments 2 replies
-
For me it's hard to understand event-like selectors, it's not how they work in CSS. In @wieslawsoltes PR I see only one inconvenience - it needs to have AddClassAction class. In Avalonia applications manipulating with classes is quite common, so as for me it makes sense to include this action in the Behaviors SDK package. Another question, why users need to include some another package for such basic functionality. It makes sense to have some Triggers support out of box, and there already were some discussions - #1362 #2427 |
Beta Was this translation helpful? Give feedback.
-
This is something that event selector would make possible: <Style Selector="Button[Click].clickAnim PathIcon.anim1">
<Style.Animations>
<Animation Duration="0:0:1">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="0.0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="1.00" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
<Style Selector="Button[Click].clickAnim PathIcon.anim2">
<Style.Animations>
<Animation Delay="0:0:1" Duration="0:0:1">
<KeyFrame Cue="0%">
<Setter Property="Opacity" Value="1.0" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Opacity" Value="0.00" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style> <Button Classes="clickAnim" Content="Click Me">
<Panel>
<PathIcon Classes="anim1" Data="{StaticResource icon1}"/>
<PathIcon Classes="anim1" Data="{StaticResource icon2}"/>
</Panel>
</Button> |
Beta Was this translation helpful? Give feedback.
-
It feels more natural to set a class name when some event is raised instead of working with events directly. The |
Beta Was this translation helpful? Give feedback.
-
me, @wieslawsoltes and alot of folks are trying to use styles for scenarios that only triggers when a certain event is called. In this wasabi PR, @wieslawsoltes made alot of boilerplate just for this imho "basic" feature.
We probably need to implement this in our selectors so that people wont have to do this tedious stuff.
cc @AvaloniaUI/core
Beta Was this translation helpful? Give feedback.
All reactions