Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6174627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:47:06+00:00 2026-05-23T23:47:06+00:00

I use WPF with a ListView control. When a certain parameter is set to

  • 0

I use WPF with a ListView control.

When a certain parameter is set to True i want the row in the ListView to have a blinking animation.

I have the following code which works but the animation stops once the mouse is over the row with the animation.

I want the animation to continue until the parameter is changed back to False.

<ListView.ItemContainerStyle>
    <Style TargetType="ListViewItem">
        <Setter Property="IsSelected" Value="{Binding Selected}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding DoBlink}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard FillBehavior="Stop">
                            <ColorAnimation Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" 
                                            From="Blue" To="LightBlue" Duration="0:0:0.2"
                                            AutoReverse="True" RepeatBehavior="Forever" />
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>
</ListView.ItemContainerStyle>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:47:06+00:00Added an answer on May 23, 2026 at 11:47 pm

    This situation will require a MultiDataTrigger. Try something like this.

    <Style
            TargetType="{x:Type ListViewItem}">
            <Setter Property="IsSelected" Value="{Binding Selected}"/>
            <Setter
                Property="Template">
                <Setter.Value>
                    <ControlTemplate
                        TargetType="{x:Type ListViewItem}">
                        <Border
                            Name="Border"
                            SnapsToDevicePixels="True"
                            Padding="2,2,2,2"
                            Background="Transparent">
                            <ContentPresenter />
                        </Border>
                        <ControlTemplate.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition
                                        Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsMouseOver}"
                                        Value="True" />
                         <Condition
                            Binding="{Binding DoBlink}"
                            Value="True" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.EnterActions>
                                    <BeginStoryboard
                                        Name="Flash">
                                        <Storyboard
                                            FillBehavior="Stop">
                                            <ColorAnimation
                                                Storyboard.TargetProperty="Background.Color"
                                                Storyboard.TargetName="Border"
                                                From="Blue"
                                                To="LightBlue"
                                                Duration="0:0:0.2"
                                                AutoReverse="True"
                                                RepeatBehavior="Forever" />
    
                                        </Storyboard>
                                    </BeginStoryboard>
                                </MultiDataTrigger.EnterActions>
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition
                                        Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsMouseOver}"
                                        Value="False" />
                                    <Condition
                                        Binding="{Binding DoBlink}"
                                        Value="True" />
                                </MultiDataTrigger.Conditions>
                                <MultiDataTrigger.EnterActions>
                                    <StopStoryboard
                                        BeginStoryboardName="Flash" />
                                </MultiDataTrigger.EnterActions>
                            </MultiDataTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style> 
    

    You will also need to use a MultiDataTrigger to stop the animation when the condition match when you would like it to stop.

    EDIT: You can read about MultiDataTriggers here

    EDIT 2: I have modified the code to work with a control template and added a set of conditions to stop the animation when another item is selected.

    EDIT 3: Remove unneeded IsSelected condition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to add different Controls/UserControls in a WPF ListView. The Controls can
Edit: Rewritting question I use the Project Management Library from http://dlhsoft.com/Home.aspx in my WPF
Goal: Latest added data should be on the first line in the listview (WPF).
I use a List to populate a WPF GridView as its ItemsSource . This
I'm trying to learn how to use WPF binding and the MVVM architecture. I'm
Let's say I have a List<MyObject> , which stores class MyObject { public String
How do I format and throw my controls in a layout in WPF? I
I'm using WPF and .NET 4.0. Recently in one of my programs I switched
I am asking for a programming approach. This is my problem: I have a
I'm trying to choose the best way to implement this UI in MVVM manner.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.