WindowsCommunityToolkit
WindowsCommunityToolkit copied to clipboard
ColorPicker Updates
Fixes / Updates
Relates to updates mentioned in #3643
- Create a new
ColorPreviewer
primitive and use it in theColorPicker
- Enables new
ShowAccentColors
property - Fixes #4208
- Enables new
- Remove obsolete
ColorToColorShadeConverter
(replaced byAccentColorConverter
) - Use a corner radius of 4 to match Fluent v2
- Switch to using
NumberBox
for color channel inputs - [WIP] Add back drop shadow behind preview color
Closes #3643, #4208
PR Type
What kind of change does this PR introduce?
- Bugfix
- Feature
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
- [x] Based off latest main branch of toolkit
- [x] Tested code with current supported SDKs
- [ ] ~New component~
- [ ] ~Pull Request has been submitted to the documentation repository instructions. Link: ~
- [ ] ~Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)~
- [ ] ~If control, added to Visual Studio Design project~
- [x] Sample in sample app has been added / updated (for bug fixes / features)
- [ ] ~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates]~(https://github.com/CommunityToolkit/WindowsCommunityToolkit-design-assets)
- [ ] ~New major technical changes in the toolkit have or will be added to the [Wiki]~(https://github.com/CommunityToolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] ~Tests for the changes have been added (for bug fixes / features) (if applicable)~
- [x] Header has been added to all new source files (run build/UpdateHeaders.bat)
- [ ] Contains NO breaking changes - Very minor changes to templates and removed an obsolete converter
Other information
Thanks robloo for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌
I attempted to add back a drop shadow using the new AttachedDropShadow
. AttachedDropShadow is a very poor development experience compared to DropShadowPanel
which nicely encapsulated related ideas into a container control. Now there are major limitations it seems and its just a thin wrapper over the way composition works (which is also poorly designed and doesn't fit in with XAML).
Concerns aside: I will need someone to recommend fixes for the drop shadow in ColorPreviewer.xaml
. The code I have doesn't work and I'm not sure why.
- Can't use x:Bind in a template
- Binding by ElementName can't work in a resource dictionary
- AttachedDropShadow can't exist as a child with other UI elements
Note that this PR is awaiting feedback from the repository maintainers on what to do with drop shadows. See discussions above.
Wanted to drop a note to say this hasn't been forgotten. ColorPicker just didn't make the cut for porting to the new repo for our 8.0 release. It's been highly missed though, so we'll want to bring it forward in 8.1. @niels9001 @Arlodotexe we should use this PR as a base for the port. @niels9001 maybe we can investigate the updates here, the new Segmented control, and how we can deal with the styling for shadow (or non-shadow style) since I know we've been doing a pass on Win 11 style updates as we port.
While I've stepped away from UWP/WinUI3 for now please note the definitive version of this control is now in Avalonia. There were many enhancements and lessons learned applied there.
Only some of those enhancements are in this PR. If this control is going to be in 8.1 it might be a good idea to port back some of those ideas.