-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Summary
MouseUp events should be raised whenever the mouse is pushed, dragged, then released on any of the sliders in the HSV/HSL/RGB tabs.
Reproduction Steps
- Create a PortableColorPicker instance
- Add a MouseUp event handler for the instance
- Add code to handle the mouse up event by printing output so that you can see when the event is raised
- Run the application
- Expand the picker
- Push+drag on any of the values in the HSV/HSL/RGB sliders
Observe - MouseUp is not raised
Expected - MouseUp is raised
Additional info - The MouseUp event is raised when performing the following actions:
- Clicking on the ring for picking hue
- Dragging on the ring for picking hue
- Clicking on the box for picking saturation and brightness
- Dragging on the box for picking saturation and brightness
- Clicking on any of the HSV/HSL/RGB sliders
Only push+drag is inconsistent - it does not raise the event
System Info
- Windows 11
- WPF
- .NET 4.7.2
GIFs
The following gif shows the correct behavior for all of the operations outlined as working in the Additional info section above. Note that I am showing the UI and also the output window printing changes.
The following gif shows the incorrect behavior where the event is not raised on a push+drag:
Use Case
The ability to detect a moue click on the control is very important for the application I am developing - https://github.com/vchelaru/Gum
This application records operations for undo, and performs auto-saving of the project whenever a variable changes. Unfortunately, performing undos and saving whenever the ColorChanged event is raised is problematic because it causes a LOT of file IO and dozens of undo snapshots being stored.
Instead, I'd like to respond to whenever the color value change is committed rather than while the change is still happening during a drag. I haven't found any events for determining if a color change occurred while the user is still dragging compared to when the user has finished dragging, so to work around this I'm subscribing to the MouseUp event. This works fine in most cases, but it is not being raised whenever the mouse is dragged over the sliders.
Update 1
PreviewMouseUp seems to be raised for all controls so this is a suitable workaround for me. I'm not sure if the behavior listed above is as intended or not, so I'll leave the issue open in case it is actually a bug. Feel free to close if it's working as intended.

