mrlacey / MauiAppAccelerator

A Visual Studio extension to accelerate the creation of new .NET MAUI apps.
https://marketplace.visualstudio.com/items?itemName=MattLaceyLtd.MauiAppAccelerator
MIT License
351 stars 10 forks source link

Dark Mode and CollectionView DataTemplate #41

Open VeryKross opened 12 months ago

VeryKross commented 12 months ago

Describe the bug The generated CollectionView DataTemplate for ListDetail is unreadable when run on an OS set to Dark Mode. This has been reproduced under both Windows and iOS.

To Reproduce Steps to reproduce the behavior:

  1. Generate the default app template that includes the ListDetail page.
  2. Run the app on a Windows or iOS machine set to use Dark Mode
  3. The list will effectively render with black text on a black background

Expected behavior Text should be reasonably colored (foreground and background) as appropriate to both Light and Dark modes on all platforms.

Screenshots image image image

Versions (please complete the following information):

Additional context Just removing the TextColor setting in the DataTemplate appears to resolve the issue.

mrlacey commented 12 months ago

Thanks for reporting. I'm now wondering why this was ever included or if it ever worked...I'll investigate

mrlacey commented 12 months ago

Hmmm. I can't repro this.

Here's the app running on Win11 in both light and dark modes.

image

image

In both, the frame background is white so that you're not seeing this at all in your screenshots makes me wonder if any content has loaded at all.

If I remove the setting of the TextColor I get this:

image image

Please can you share your generated project to allow me to investigate further.

VeryKross commented 11 months ago

Hmm... that's very odd. Alright, I'll gen up a new project with the latest release and see if it still repros here. I'll also screen shot the selections I make along the way in case that makes a difference. I'll let you know either way.

mrlacey commented 2 days ago

I ran into a situation where this showed up for me today. It seems to be based on a combination of an expectation that the background of a Border will always be relative to the Theme, but on some devices/platforms/versions the color is affected by system-level theme settings. The simple solution is to explicitly set a theme relative color for the background, rather than relying on an assumption that we now know isn't always correct.

The next release (v1.7.1) will include a fix for this.