Removing ListView mousover highlight in MAUI

Robert Turner 0 Reputation points
2025-02-13T08:57:06.59+00:00

I am building an app in MAUI .NET8, and don't seem to find any way of removing the mousover highlight on a ListView item in Windows.

There are no obvious properties that I can see, nor can I find any documentation on how to do this. I found a few potential solutions online in WPF and Xamarin, but none of these seem applicable to MAUI.

Thanks in advance.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,077 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,982 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 80,606 Reputation points Microsoft External Staff
    2025-02-14T01:54:45.52+00:00

    Hello,

    Removing ListView mousover highlight in MAUI

    Please open App.xaml` in the `Platforms/Windows folder, Create a <maui:MauiWinUIApplication.Resources> and add following Resources, set the ListViewItemBackgroundPointerOver's color to Transparent

    <maui:MauiWinUIApplication
        x:Class="MauiApp8.WinUI.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:maui="using:Microsoft.Maui"
        xmlns:local="using:MauiApp8.WinUI">
     
        <!--create a MauiWinUIApplication.Resources and add following resouces-->
         <maui:MauiWinUIApplication.Resources>
              <ResourceDictionary>
                  <Color x:Key="MyListTransparentColor">#00000000</Color>
                  <SolidColorBrush x:Key="MySystemControlHighlightListLowRevealBackgroundBrush" Color="{StaticResource MyListTransparentColor}" />
                   <StaticResource x:Key="ListViewItemBackgroundPointerOver" ResourceKey="MySystemControlHighlightListLowRevealBackgroundBrush" />
             </ResourceDictionary>
         </maui:MauiWinUIApplication.Resources>
    
    </maui:MauiWinUIApplication>
    

    Best Regards,

    Leon Lu


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.