Bug 47728 - Can't change background color of selected ListView item on UWP
Summary: Can't change background color of selected ListView item on UWP
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-23 15:09 UTC by blitzillu
Modified: 2017-05-25 21:08 UTC (History)
2 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project demonstrating the issue (205.14 KB, application/zip)
2016-11-23 15:09 UTC, blitzillu
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description blitzillu 2016-11-23 15:09:44 UTC
Created attachment 18621 [details]
Sample project demonstrating the issue

I've set up two projects: One XF project with a portable library (TestListViewBackground) and an UWP project only (TestBlend). Both uses the same style. On the UWP project the style is applied if you select an item in the ListView. The background color changes here to yellow. The background color in the XF project isn't changed. It uses the default color.

The UI structure behaves differently on the two project types, but with the Live Visual Tree I can change the SolidColorBrush (for SelectedBackground) in the XF project and the ListViewItem changes accordingly.
Comment 1 Paul DiPietro [MSFT] 2017-05-25 21:08:23 UTC
I believe you should be able to add x:Key="FormsListViewItem" to the Style in App.xaml and it should help resolve this for the time being. There is discussion of potentially adding an API for the SelectedItem's background color here:

https://forums.xamarin.com/discussion/85885/listview-selected-item-background-color