-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PortableColorPicker in DataGridCell: Can't switch between primary to secondary color #33
Comments
I'm experiencing exactly the same issue described, (NET 4.8). I can't see anything out of place: <colorpicker:PortableColorPicker
Width="40" Height="20"
Margin="5 2"
Name="ColorPicker"
ColorState="{Binding Color, Mode=TwoWay, Delay=20}"
ShowAlpha="{Binding ShowAlpha}"
UseHintColor="True" HintColor="Transparent"
ToolTip="{Binding ElementName=ColorPicker,Path=HintColor}"
/> Not sure if I'll have to use the source code directly to find out what's happening. Edit: Forgot to mention that my issue is happening inside node from TreeView control. |
It was something to do with the Focus happening inside ListView/ListBox and all sort controls like that. My solution at the moment, is about overriding the style from their items, or the item you're working on. At my case a Treeview so it would looks like : <TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="Focusable" Value="false"/>
</Style>
</TreeView.ItemContainerStyle> |
hi. I looked at your solution. It also works in the DataGrid. <DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="Focusable" Value="False"/>
<Style>
</DataGrid.CellStyle> In the meantime I have created another solution using ItemsControl. The popup works in its ItemTemplate. |
Hi, sorry for not responding, we'll take a look at that. Thanks for investigation! |
The solution given didn't work on my treeview after all. I find out my issue is about Popup focus used into a TreeView. So the other way around (after reading it was something to do with WPF bugs) end up like this: PortableColorPicker.xaml ...
<popup PreviewLostKeyboardFocus="FixPopup_PreviewLostKeyboardFocus" ... >
... PortableColorPicker.cs private void FixPopup_PreviewLostKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e)
{
if (e.NewFocus is System.Windows.Controls.TreeViewItem)
{
if (popup.IsOpen)
e.Handled = true;
}
} |
Hi,
thank you for your work.
I've added a
PortableColorPicker
to aDataGridTemplateColumn
of aDataGrid
. Everything looks fine so far, but I can't switch between the primary and secondary colors.What am I doing wrong? If I use the
PortableColorPicker
outside of theDataGrid
, the switch between the colors is possible. Even if I add theStandardColorPicker
into theDataGridTemplateColumn
everything is ok.Here is my example:
Thank you für your help
Addition:
The selected items will not work in this case.
The text was updated successfully, but these errors were encountered: