-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
Colors has both, but not Brush. so we should fix this in one way or another for consistency |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@devanathan-vaithiyanathan just waiting on your CLA acceptance :) |
@dotnet-policy-service agree |
3a763a4
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VerifyGreyShades is failing
Head branch was pushed to by a user without write access
Azure Pipelines successfully started running 3 pipeline(s). |
Azure Pipelines successfully started running 3 pipeline(s). |
Hi @PureWeen , |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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
After