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

  • SEARCH
  • Home
  • 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

i want to create horizontal list with these uielements in wpf.I already use listview
Couldn't find an answer to this one. I have a WPF ListView control that
I want to use the GridView mode of a ListView to display a set
I have a ListView in a WPF Application that use Dynamic Binding . I
In WPF, I know I can use ListView.ScrollIntoView to scroll a particular item into
I want to use WPF windows in a legacy win32 application. I'd like to
Can I use the WPF DataGrid control in the same way I use a
So I'm trying to use a WPF User Control to generate a ton of
I have expanders that contain text boxes, the text boxes use the wpf validation
I am writing a WPF program in C# in which I have a ListView

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.