KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I'm after: when an item appears in my ListBox, it should flash for a few moments if the item is 'Critical' then it should remain highlighted Currently I have a DataTemplate that looks like this: <DataTemplate DataType="{x:Type Notifications:NotificationViewModel}"> <Grid HorizontalAlignment="Stretch"> <Border Name="Background" CornerRadius="8" Background="#80c0c0c0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> <Border Name="Highlight" CornerRadius="8" Background="Red" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> <!-- snip actual visual stuff --> <Grid.Triggers> <EventTrigger RoutedEvent="Grid.Loaded"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation x:Name="LoadedAnimation" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity" From="0" To="1" RepeatBehavior="5x" Duration="0:00:0.2" AutoReverse="True" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> </Grid.Triggers> </Gr
Tags (comma-separated)
Save Edits
Cancel