Borderbrush coloranimation fade in and out

11,903

Try to specify:

Storyboard.TargetProperty="BorderBrush.Color"

and either specify:

BorderBrush="any-non-transparent-color"

or in the animation:

From="any-non-transparent-color"
Share:
11,903
Ziad
Author by

Ziad

Updated on June 04, 2022

Comments

  • Ziad
    Ziad almost 2 years

    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>
    
  • Ziad
    Ziad over 12 years
    That worked, Great. thank you. But why can't i use the "Transparent". It will be more powerfull !!!
  • Felice Pollano
    Felice Pollano over 12 years
    because if you use Transparent, you will have an animation starting from transparent and moving to tyransparent, so nothing happens.
  • Ziad
    Ziad over 12 years
    As i'm learning more about animation, i can't bind the color property of the animation. i'm having an exception at run time !! any ideas?
  • Ziad
    Ziad over 12 years
    This is the new question. Thanks. stackoverflow.com/questions/7240480/…
  • user3260977
    user3260977 almost 8 years
    Setting the StoryBoard.TargetPropertly="BorderBrush.Color" complains that BorderBrush has no Color property. Do you know is that solves the problem?