Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Grey" cannot be used to set Background property #24325

Merged
merged 9 commits into from
Sep 2, 2024

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Aug 20, 2024

Root cause

The issue occurred because .NET MAUI's Brush class does not support color names with the British spelling "Grey" (e.g., Grey, DimGrey, SlateGrey). Instead, it only recognizes the American spelling "Gray." This led to a XFC0040 Cannot convert value "Grey" to "Microsoft.Maui.Controls.Brush" error when trying to use these color names in XAML.

Description of Change

To resolve this issue, I added the missing colors using the "Grey" spelling (Grey, DimGrey, SlateGrey, DarkGrey, DarkSlateGrey, LightGrey, LightSlateGrey). This fix ensures that these colors are now recognized and can be used in XAML.

Note: There is a known Visual Studio bug where the XAML preview does not display these colors correctly, even after the fix.

Issues Fixed

Fixes #21325

Output

Before
image

After
image

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Aug 20, 2024
@StephaneDelcroix
Copy link
Contributor

Colors has both, but not Brush. so we should fix this in one way or another for consistency

mattleibow
mattleibow previously approved these changes Aug 23, 2024
@mattleibow
Copy link
Member

/azp run

@mattleibow mattleibow marked this pull request as ready for review August 23, 2024 12:24
@mattleibow mattleibow requested a review from a team as a code owner August 23, 2024 12:24
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mattleibow
Copy link
Member

@devanathan-vaithiyanathan just waiting on your CLA acceptance :)

@devanathan-vaithiyanathan
Copy link
Contributor Author

@dotnet-policy-service agree

@PureWeen
Copy link
Member

PureWeen commented Aug 26, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen enabled auto-merge (squash) August 26, 2024 13:22
Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VerifyGreyShades is failing

auto-merge was automatically disabled August 27, 2024 12:54

Head branch was pushed to by a user without write access

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@devanathan-vaithiyanathan
Copy link
Contributor Author

Hi @PureWeen ,
I've added the missing screenshot for the VerifyGreyShades test case. I think the test will pass now.

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho merged commit d775eca into dotnet:net9.0 Sep 2, 2024
121 checks passed
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Sep 5, 2024
@samhouts samhouts added fixed-in-9.0.0-rc.2.24503.2 and removed fixed-in-net9.0-nightly This may be available in a nightly release! labels Oct 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants