Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Issue: ColorPicker: The MenuItem behind the clicked color is also clicked [19327]

$
0
0
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: perreaultfelix **

You need to handle your click event. This is quite easy. Just bind a handling method to the ViewModel. The method should do something like :

private RelayCommand<RoutedEventArgs> _handle;
public RelayCommand<RoutedEventArgs> Handle
{
get
{
return _handle ??
(_handle = new RelayCommand<RoutedEventArgs>(ExecuteHandle));
}
}

private void ExecuteHandle(RoutedEventArgs obj)
{
obj.Handled = true;
}


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>