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.63k stars 1.62k forks source link

OnIdiom doesn't respect Desktop setting on Windows #22093

Open KeithBoynton opened 2 weeks ago

KeithBoynton commented 2 weeks ago

Description

When using this for example:

TextColor="{OnIdiom Desktop='Red', Default='Black'}"

Running a solution on Windows the text is Black when I would expect it to be Red.

It works as expected when running on MacCatalyst, the text is Red. It works as expected when running on iOS, the text is Black. It works as expected when running on Android, the text is Black. It does not work as expected when running on Windows, the text is Black.

Steps to Reproduce

1. Clone the attached project
2. Run the solution on MacCatalyst
3. Observe the text Red (as expected)
4. Run the solution on iOS
5. Observe the text Black (as expected)
6. Run the solution on Android
7. Observe the text Black (as expected)
8. Run the solution on Windows
9. Observe the text Black (NOT expected, Red was expected)

Link to public reproduction project repository

https://bitbucket.org/KeithBoynton/on-idiom-desktop-issue/src/master/

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

ninachen03 commented 1 week ago

Verified this issue with Visual Studio 17.10.0 Preview 5 ( 8.0.21).I can not repro this issue. image

KeithBoynton commented 1 week ago

Not working for me on Visual Studio 17.10.0 Preview 5 ( 8.0.21)

image

What am I missing?

ninachen03 commented 1 week ago

We have verified that this problem, does not recur on 5 machines. We are not sure why it still reoccurs. Does it occur in a specific environment setting? In order for us to investigate this further, could you provide the Msbuild Log and binLog?

jfversluis commented 1 week ago

Just tried this myself and same here, with your exact code, no changes, I see the text as red so I wonder what the difference is. Also tried a release build and same there.

Can you run dotnet --info and maybe add that info? Make sure you have installed the latest .NET 8 with the .NET MAUI workload?

KeithBoynton commented 1 week ago

Please find attached build output and also the dotnet info. FYI I did a dotnet workload update but it's still the same.

dotnet-info.txt OnIdiom-desktop-issue-build-output.txt

jfversluis commented 4 days ago

Very strange and I don't have a good explanation for it for now unfortunately. This one seems to might be related? #21799

So maybe when that gets merged, that might fix this too

KeithBoynton commented 3 days ago

Ok, I've subscribed to that issue.. however it's a draft and no activity on it for 3 weeks. What's blocking that being merged do we know?