Categories > Coding > HTML >

[XAML Help] How to Fix This ColorAnimation Problem in Style

TERIHAX

i say im gay as a joke 🙀

Posts: 2239

Threads: 102

Joined: Jul, 2020

Reputation: 32

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

  • 0

Posts: 197

Threads: 10

Joined: Feb, 2021

Reputation: 9

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 

  • 0

Im netral, not evil, not too kind either.

TERIHAX

i say im gay as a joke 🙀

Posts: 2239

Threads: 102

Joined: Jul, 2020

Reputation: 32

Replied

@OrbitRBX wait wdym i dont understand

 

ohh i get it now yh thx it works now

  • 0

Zera

Casual Femboy Agent

vip

Posts: 1556

Threads: 39

Joined: Mar, 2020

Reputation: 42

Replied

Add autoreverse as false and dont set color as transparent.

  • 0

https://cdn.discordapp.com/attachments/995469995742068832/1073019970012848228/Untitled39_20220604185345.png

TERIHAX

i say im gay as a joke 🙀

Posts: 2239

Threads: 102

Joined: Jul, 2020

Reputation: 32

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

  • 0

Posts: 10

Threads: 2

Joined: Jun, 2020

Reputation: 0

Replied

why'd u not put a filter 

  • 0

TERIHAX

i say im gay as a joke 🙀

Posts: 2239

Threads: 102

Joined: Jul, 2020

Reputation: 32

Replied

@Hovereffect ??????

 

Content length must be 10-5000 chars

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )