When selecting a color from the `ColorPicker` popup that placed inside a Menuitem, if there is a MenuItem behind the clicked color, it will also be clicked. In my case, the menu item that was unintentionally activated was "Undo", which undid the color selection. Therefore certain colors could never be selected.
The problem is that after the popup has been closed due to a `MouseDown`, the `MenuItem` will then get the `MouseUp`, unless the user keeps holding the mouse button down, moves it away, and then releases - unlikely. The popup should only close after a `MouseUp`.
Comments: ** Comment from web user: johnalammers **
The problem is that after the popup has been closed due to a `MouseDown`, the `MenuItem` will then get the `MouseUp`, unless the user keeps holding the mouse button down, moves it away, and then releases - unlikely. The popup should only close after a `MouseUp`.
Comments: ** Comment from web user: johnalammers **
A terrible hack, but I managed to work around this by setting a ignoreMouseUp flag on my ColorPicker.SelectedColorChanged and then looking for that in PreviewMouseUp of my menu items. If the flag's set, I swallow that event and clear the flag. Only really works because I'm building my context menu dynamically and can coordinate across items like this. Don't know that I'd be able to pull that off in a simpler or XAML-based scenario.