Change color of states in ListviewItem. UWP

Anderson Cavalcante 21 Reputation points
2022-08-11T21:02:07.293+00:00

I'm trying to change border color when MouseHover. I want to change color in Normal On Hover and Selected On Hover

Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,223 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,636 Reputation points
    2022-08-12T06:15:57.24+00:00

    You can copy/modify the default Style, like I did in this thread : How to customize XAML ListView colors?


  2. Nico 106 Reputation points
    2022-08-16T01:26:44.85+00:00

    Hello,
    Welcome to Microsoft Q&A!

    Change color of states in ListviewItem. UWP

    Sure, you could find the default CommonStates in ListViewItemRevealStyle, and RevealBorderBrush is the target border that you need to edit, and you just need to override default RevealBorderBrush ThemeResource for each states.

    For example

    ListViewItemRevealBorderBrushPointerOver

    <RevealBorderBrush  
        x:Key="ListViewItemRevealBorderBrushPointerOver"  
        FallbackColor="Aqua"  
        TargetTheme="Dark"  
        Color="DarkBlue" />  
    

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments