Categories > Coding > HTML >
[XAML Help] How to Fix This ColorAnimation Problem in Style
Posted
So uh how do i fix this problem in my style?
Problem:
https://gyazo.com/a1854056fc7ef8a7354dfa4703f901c8
it blinks to white then switches to the color i want, i just cant seem to understand what causes it
my style:
<!-- Wrd Code Block Cut Out Some Parts Idk Why -->
<Style TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Back" Background="Transparent" SnapsToDevicePixels="True">
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation
Duration="0:0:0.3" Storyboard.TargetName="Back" Storyboard.TargetProperty="Background.(SolidColorBrush.Color)" To="#1E1E1E"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation
Duration="0:0:0.3" Storyboard.TargetName="Back" Storyboard.TargetProperty="Background.(SolidColorBrush.Color)" To="Transparent"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
So uh wrd codeblock removed some of my code idk why so heres the style in a paste.ee: https://paste.ee/p/7DDya
alr zera and orbit fixed it
Replied
I think its because the to transparent
When u do the exit action don't set the to and just delete it and ignore ye ez fix
Not tested yet but should work
Cancel
Post
Im netral, not evil, not too kind either.
Replied
Add autoreverse as false and dont set color as transparent.
Cancel
Post
https://cdn.discordapp.com/attachments/995469995742068832/1073019970012848228/Untitled39_20220604185345.png
Replied
@Zera okei
ok i tried with auto reverse to false, doesnt work, but for the setting to transparent thingy, i changed it to #00000000 which is like transparent so that fixed it
Cancel
Post
Replied
why'd u not put a filter
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post