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 8152293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:40:01+00:00 2026-06-06T15:40:01+00:00

I have been working on a new style for my list boxes but I

  • 0

I have been working on a new style for my list boxes but I have ran into an issue. When I hover over any of the items in the list box my animation runs on all the item not just the one I hovered over. I been looking on the internet but it seems like there is a bunch of different ways to do this but non of them solve this issue for me.

<Color x:Key="BorderColor" A="255" R="216" G="217" B="220" />
<Color x:Key="ForegroundColor" A="255" R="40" G="40" B="40" />
<Color x:Key="BackgroundColor" A="255" R="240" G="241" B="241" />

<SolidColorBrush x:Key="BorderBrush" Color="{StaticResource BorderColor}" />
<SolidColorBrush x:Key="ForegroundBrush" Color="{StaticResource ForegroundColor}" />        
<SolidColorBrush x:Key="BackgroundBrush" Color="{StaticResource BackgroundColor}" />

<Color x:Key="Color_Red" A="255" R="235" G="103" B="103" />

<Style x:Key="Test" TargetType="{x:Type ListBoxItem}">
    <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="ListBoxItem">
                <Border x:Name="Border" Background="{StaticResource BackgroundBrush}" BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,0,0,3" CornerRadius="0" Margin="0,0,2,3" Padding="0" SnapsToDevicePixels="true">
                    <Grid Height="Auto" Width="Auto">
                        <ContentPresenter Margin="3,3,0,0" VerticalAlignment="Top" />
                    </Grid>
                </Border>
                <ControlTemplate.Triggers>
                    <EventTrigger RoutedEvent="ListBoxItem.MouseEnter">
                        <EventTrigger.Actions>
                            <BeginStoryboard>
                                <Storyboard>
                                    <ColorAnimation Duration="0:0:0.5"
                                                    Storyboard.TargetName="Border"
                                                    Storyboard.TargetProperty="BorderBrush.Color" To="{StaticResource Color_Red}" />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger.Actions>
                    </EventTrigger>
                    <EventTrigger RoutedEvent="ListBoxItem.MouseLeave">
                        <EventTrigger.Actions>
                            <BeginStoryboard>
                                <Storyboard FillBehavior="Stop">
                                    <ColorAnimation Duration="0:0:0.3"
                                                    Storyboard.TargetName="Border"
                                                    Storyboard.TargetProperty="BorderBrush.Color" To="{StaticResource BorderColor}" />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger.Actions>
                    </EventTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Any help would be greatly appreciated, I been stuck on this for a while…

Thank You!

  • 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-06-06T15:40:03+00:00Added an answer on June 6, 2026 at 3:40 pm

    Off the top of my head I think you’re animating the resource instead of just the border color, try changing the Border declaration to.

    <Border x:Name="Border" Background="{StaticResource BackgroundBrush}"  BorderThickness="0,0,0,3" CornerRadius="0" Margin="0,0,2,3" Padding="0" SnapsToDevicePixels="true">
        <Border.Style>
            <Style TargetType="{x:Type Border}">
                <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
            </Style>
        </Border.Style>
        <Grid Height="Auto" Width="Auto">
            <ContentPresenter Margin="3,3,0,0" VerticalAlignment="Top" />
        </Grid>
    </Border>
    

    Basically remove the Border brush from the border line and put it in a style setter below.

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

Sidebar

Related Questions

I have been working on a new menu and I'm almost there, but the
Alright have been working to switch to jQuery 1.7's new and improved .on() function
I have been working on Eclipse recently. I am fairly new to java programming,
I have been working on test framework, which creates a new app domain to
I'm new to AS3 and have been working on an XML driven navigation system
I am new to github. I have been working on a code that I
I'm already new in C++CLI , although I have been working on VB and
I am new to Spring Security. I have been working on creating a custom
I am very new to javascript and ajax/jquery and have been working on trying
I'm pretty new to web design and have recently been working on an amatuer

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.