tags:

views:

12

answers:

1

For example, if I have a border with a style like this:

                    <Border>
                        <Border.Background>
                            <SolidColorBrush />
                        </Border.Background>
                        <Border.Style>
                            <Style TargetType="Border">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding StatusCode}"
                                                 Value="Status1">
                                        <DataTrigger.EnterActions>
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                                    From="Transparent"
                                                                    To="Red"
                                                                    Duration="0:0:0.9"
                                                                    DecelerationRatio="0.1"
                                                                    AccelerationRatio="0.9"
                                                                    AutoReverse="False"
                                                                    RepeatBehavior="Forever" />
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </DataTrigger.EnterActions>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>

Is there any way to move all that stuff inside the datatrigger to a template?

+1  A: 

http://rob.runtothehills.org/archives/88

This guy has experienced the pain and had a nice overview which should help you.

halfevil
Great find. Exactly what I was looking for. Thanks!
hypoxide
Glad to be of help.
halfevil