Silverlight 4.0 VisualStateManager

Posted by xscape on Stack Overflow See other posts from Stack Overflow or by xscape
Published on 2010-04-12T11:11:36Z Indexed on 2010/04/12 11:13 UTC
Read the original article Hit count: 862

Can anyone please help me or is there anything I miss out? the visualstate is not triggered

xmlns:swi="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:esi="clr-namespace:Expression.Samples.Interactivity;assembly=Expression.Samples.Interactivity" xmlns:mei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"

<my:DataGridTemplateColumn IsReadOnly="True">
                <my:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                        <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="vsgUrgency">
                                    <VisualState x:Name="UrgencySerious">
                                        <Storyboard>
                                            <ColorAnimation Storyboard.TargetName="orbUrgency"
                                        Storyboard.TargetProperty="Fill" To="Red"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="UrgencyNormal">
                                        <Storyboard>
                                            <ColorAnimation Storyboard.TargetName="orbUrgency"
                                        Storyboard.TargetProperty="Fill" To="Green"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>    
                            <swi:Interaction.Triggers>
                                <esi:DataTrigger Binding="{Binding Urgency}" Value="Serious">
                                    <mei:GoToStateAction StateName="UrgencySerious"/>
                                </esi:DataTrigger>
                                <esi:DataTrigger Binding="{Binding Urgency}" Value="Normal">
                                    <mei:GoToStateAction StateName="UrgencyNormal"/>
                                </esi:DataTrigger>
                            </swi:Interaction.Triggers>
                            <TextBlock Text="{Binding Urgency}"/>
                            <Path x:Name="orbUrgency" Width="14.6566" Height="14.5449" Stretch="Fill" StrokeThickness="1" 
                            StrokeLineJoin="Round" Fill="#FFE50A0A" 
                            Data="F1 M 9.3269,3.61737C 13.3742,3.61737 16.6552,6.87332 16.6552,10.8898C 16.6552,14.9063 13.3742,18.1623 9.3269,18.1623C 5.2796,18.1623 1.99862,14.9063 1.99862,10.8898C 1.99862,6.87332 5.27956,3.61737 9.3269,3.61737 Z ">
                            </Path>
                        </StackPanel>
                    </DataTemplate>
                </my:DataGridTemplateColumn.CellTemplate>
            </my:DataGridTemplateColumn>

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about visualstatemanager