private void OnButtonClick(object sender, RoutedEventArgs routedEventArgs) { if (Keyboard.Modifiers == ModifierKeys.Control && !Popup.IsOpen) { routedEventArgs.Handled = true; Color = ScreenColorPickerDialog.Pick() ?? Color; } }
private void PickerButton_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var picker = ColorPicker.GetLastOpened(); if (picker?.Popup != null) { picker.Popup.StaysOpen = true; } Color = ScreenColorPickerDialog.Pick() ?? Color; if (picker?.Popup != null) { picker.Popup.Focus(); picker.Popup.StaysOpen = false; } }