ColorPicker Color property doesn't work
See original GitHub issueDescribe the bug
When modifying the Color
property manually, the color of the ColorPicker
doesn’t change
However, when modifying the HsvColor
property, the color changes correctly
I found in the xml that the ColorPicker
uses the HsvColor
property to draw its Background
. This property should automatically change when the Color
property changes, but this is not happening because the ignorePropertyChanged
is set to true for the ColorPicker
To Reproduce
Create a ColorPicker
and change its Color
ColorPicker colorPicker = new ColorPicker();
colorPicker.Color = new Color(255, 255, 0, 0);
Expected behavior
The color of the ColorPicker
(and the ColorView
popup) should change
Desktop (please complete the following information):
- OS: Ubuntu 22.04
- Version 11.0-preview1
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
colorpicker can't set value to property
It's okay but when I change color and submit the changed values does not comes to post controller. in post usViewModel.UsColor; comes null....
Read more >"Keep going with Apps" Color Picker ERROR
The issue is that the colorpicker does not run in the preview pane, only in the app. If you are using Playground on...
Read more >Color picker color selector doesn't work in IE11
Hello, I have recently implemented the Color Picker in my site and I'm having issues in IE 11. The color picker opens, however,...
Read more >TextStim won't appear when I use the color picker
I tried to use the color picker for a visual. ... values in the code match the values in the property menu, save...
Read more ><input type="color"> - HTML: HyperText Markup Language
Here we establish some variables, setting up a variable that contains the color we'll set the color picker to when we first load...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the background you gave. Makes sense to me. But you may be right about the lifecycle thing.
I have a fix for this that is the lesser of two evils. It will be included with #9140.
What it does is switch the main processing from the
ColorView
hosted in the control template to theColorPicker
itself. This works-around lifetime limitations with how the control is created (and the template applied, I got lazy trying to make the control as simple as possible and overlooked this). As a side-effect, a new property forIsHostedInColorPicker
is added – that’s the lesser of two evils. I normally don’t like properties like this but the alternative was to attempt to pass control back-and-forth between theColorPicker
andColorView
based on when the template is applied. That is potentially error-prone and is likely difficult to maintain.Also see the discussion here: https://github.com/AvaloniaUI/Avalonia/discussions/9128