Skip to content

Added color converters samples#159

Merged
TheCodeTraveler merged 6 commits intoCommunityToolkit:mainfrom
juansturla:52-53-54-Add-Color-Converters-Samples
Oct 19, 2021
Merged

Added color converters samples#159
TheCodeTraveler merged 6 commits intoCommunityToolkit:mainfrom
juansturla:52-53-54-Add-Color-Converters-Samples

Conversation

@juansturla
Copy link
Copy Markdown
Contributor

This is for a sample for
#52 Color to Colors converter
#53 Color to Color Component Converter
#54 Color to String converter

Based on MCT Sample, with some modifications on the code-behind:

  • Labels with FormattedStrings did not work with <span>. Changed for a Text with StringFormat
  • BoxView at the bottom of the page did not work either, had to move it to the top and set a default BackgroundColor ="White"
  • There a warning at the constructor that says that the picker and the boxView might not have a value (I supressed the warning)
  • I had to change the dictionary to be null-safe (if the FieldInfo.Value is null, returns Colors.White

Based on MCT Sample, with some modifications:
- Formatted Strings did not work
- BoxView at the bottom did not work either
- There is a weird warnings on the Constructor
To black and white
To Color for text
To Grayscale color
To inverse color
@pictos
Copy link
Copy Markdown
Member

pictos commented Oct 19, 2021

There a warning at the constructor that says that the picker and the boxView might not have a value (I supressed the warning)

Probably that's caused by the source generator, maybe they fix it in the next release. For reference:

For the other bugs I'll open issues on maui repo (feel free to do it, if you can and want to do)

Copy link
Copy Markdown
Collaborator

@TheCodeTraveler TheCodeTraveler left a comment

Choose a reason for hiding this comment

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

Thanks @juansturla!

Just a couple things to tweak 👍

Comment thread samples/CommunityToolkit.Maui.Sample/Pages/Converters/ColorsConverterPage.xaml.cs Outdated
Comment thread samples/CommunityToolkit.Maui.Sample/Pages/Converters/ColorsConverterPage.xaml Outdated
Comment thread samples/CommunityToolkit.Maui.Sample/Pages/Converters/ColorsConverterPage.xaml Outdated
Comment thread samples/CommunityToolkit.Maui.Sample/Pages/Converters/ColorsConverterPage.xaml.cs Outdated
Capitalized variables
Removed #pragma
Changed Dictionary to IReadOnlyDictionary
@juansturla
Copy link
Copy Markdown
Contributor Author

Requested changes were solved

@TheCodeTraveler TheCodeTraveler self-assigned this Oct 19, 2021
@TheCodeTraveler TheCodeTraveler added this to the v1.0.0 milestone Oct 19, 2021
@TheCodeTraveler TheCodeTraveler enabled auto-merge (squash) October 19, 2021 21:48
@TheCodeTraveler
Copy link
Copy Markdown
Collaborator

Approved. Thanks @juansturla!

@TheCodeTraveler TheCodeTraveler merged commit cb9706e into CommunityToolkit:main Oct 19, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants