开发者

Switching between styles in Storyboard to receive blinking LED

开发者 https://www.devze.com 2023-03-16 00:41 出处:网络
I have a simple Ellipse. On its \"Fill\" Property i attached a RadialGrientBrush, which makes it look like an \"LED\"

I have a simple Ellipse. On its "Fill" Property i attached a RadialGrientBrush, which makes it look like an "LED" I may change the Fill Property in a DataTrigger without problems.

But on some Data Values, i want to have a blinking LED. it shall switch continuously between my Black RadialGradientBrush and my Red RadialGradientBrush.

I found some Animation Syntax but none of them works, i dont want a smooth animation, i just want to switch the Fill property in an infinite loop.

this is my "normal" way to set my style:

<Ellipse ...>
    <Ellipse.Ressources>
        <Style>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=someproperty, Mode=OneWay}" Value="on">
                    <Setter Property="Fill" Value="{StaticResource GreenLEDBrush}" />
                </DataTrigger>
            </Style.Triggers>
         </Style>
     </Ellipse.Ressources>
</Ellipse>开发者_开发问答;

and now my approach was:

<DataTrigger Binding="{Binding Path=shallblink, Mode=OneWay}" Value="True">
<DataTrigger.EnterActions>
    <BeginStoryboard>
        <Storyboard RepeatBehavior="Forever">

        </Storyboard>
    </BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>

I was not able to get what i want... Maybe someone may help?

0

精彩评论

暂无评论...
验证码 换一张
取 消