dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.83k stars 1.67k forks source link

Global style disables specific style #20291

Open Legends opened 5 months ago

Legends commented 5 months ago

Description

Setting the backgroundColor property of a datatemplate inside of App.xaml disables a style specified in contentpage.

Repo and reproduction steps can be found here: Issue

Steps to Reproduce

Repro:

Repro:

  1. Add Background="Pink" to DataTemplate x:Key="AnimalTemplate" in App.xaml
  2. Run the app
  3. Select a cat
  4. Navigate back to CatsPage.xaml

The previously selected cat is in selected state, but the backgroundColor didn't change.

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/8.0/Fundamentals/Shell

Version with bug

8.0.6

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

Android 11-API 30, Win 10

Did you find any workaround?

no

Relevant log output

No response

ghost commented 5 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

rmarinho commented 5 months ago

Can you see if you change instead of Background use BackgroundColor like the property used on VSM on the CatsPage.

Legends commented 5 months ago

Can you see if you change instead of Background use BackgroundColor like the property used on VSM on the CatsPage.

Happens on both

XamlTest commented 3 months ago

Verified this on VS 17.10.0 Preview 1.0(8.0.7). Repro on Windows 11, Android 14.0-API34, iOS 17.2 and MacCatalyst with below Project: Xaminals.zip