Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Borderbrush coloranimation fade in and out

i have a border , and i change it's borderbrush in the run time. now i need this border to be glowing all the time, whatever the color was.

i tried this but i have problems. any one can help?

<Border   Name="ActiveBorder"  VerticalAlignment="Stretch" Height="auto"  BorderBrush="Transparent" BorderThickness="2" >
            <Border.Style>
                <Style TargetType="{x:Type Border}">
                    <Style.Triggers>
                        <Trigger Property="Visibility" Value="Visible">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation AutoReverse="True" RepeatBehavior="Forever" Storyboard.TargetProperty="BorderBrush" Duration="00:00:01" To="Transparent"></ColorAnimation>       
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                        </Trigger>
                    </Style.Triggers>
                </Style>
        </Border.Style>
like image 282
Ziad Avatar asked Nov 25 '25 09:11

Ziad


1 Answers

Try to specify:

Storyboard.TargetProperty="BorderBrush.Color"

and either specify:

BorderBrush="any-non-transparent-color"

or in the animation:

From="any-non-transparent-color"
like image 127
Felice Pollano Avatar answered Nov 26 '25 23:11

Felice Pollano



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!