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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:07:45+00:00 2026-05-26T17:07:45+00:00

This is defined in App.xaml inside <Application.Resources> : <Style x:Key=borderStyle TargetType=Border> <Style.Triggers> <Trigger Property=IsMouseOver

  • 0

This is defined in App.xaml inside <Application.Resources> :

<Style x:Key="borderStyle" TargetType="Border">
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="BorderBrush" Value="Red" />
        </Trigger>
    </Style.Triggers>
</Style>

And I am using it here inside Window1.xaml :

<ListBox Name="listView1" ItemsSource="{Binding}" Background="Black" >
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"  Orientation="Horizontal" ItemWidth="150" ItemHeight="150" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Border BorderThickness="5" BorderBrush="DarkGray" Style="{StaticResource borderStyle}">
                            <Image  Width="120"  Height="120" Stretch="Fill"  Source="{Binding Image}" />
                         </Border>
                        <TextBlock FontFamily="Verdana"  Foreground="Orange"  Text="{Binding Title}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

But it doesn’t work, when I mouse over it, the border doesn’t change the color.

What am I doing wrong ?

Thanks.

  • 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-26T17:07:45+00:00Added an answer on May 26, 2026 at 5:07 pm

    You are overriding the trigger if you define the property directly within the border.

    Remove BorderBrush="DarkGray"from this line

    <Border BorderThickness="5" BorderBrush="DarkGray" Style="{StaticResource borderStyle}">
    

    so it looks like this

    <Border BorderThickness="5" Style="{StaticResource borderStyle}">
    

    and add a setter to your style

    <Style x:Key="borderStyle" TargetType="Border">
        <Setter Property="BorderBrush" Value="DarkGray" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderBrush" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>
    

    As a thumb rule: all properties which should be modified by triggers have to be defined as setters within the style.

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

Sidebar

Related Questions

I have the following style defined in my App.xaml <Style x:Key=textBoxMultiline TargetType={x:Type TextBox} >
I'm developing a Windows Phone application . I have defined this on App.xaml: <nav:UriMapping
I have the following custom defined Button defined in my App.xaml file. <Style x:Key=DispatchListCallButton
In the App Engine docs , a JID is defined like this: An application
I'm using a progress bar in my app, this progress bar is defined inside
In a WPF app I have a ResourceDictionary with Style defined for the TargetType
I've added PresentationFramework.Aero to my App.xaml merged dictionaries, as in... <Application x:Class=TestApp.App xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml>
I am trying to alias a resource in XAML, as follows: <UserControl.Resources> <StaticResourceExtension x:Key=newName
My situation is like following. I have a App.xaml which includes Style for ListView
In App.xaml I have the following code: <Application xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=FJW.App> <Application.Resources> <!-- Resources

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.