I am using the WPF Color Palette to set the background color for multiple objects in a diagram. I want to be able to set multiple objects to the same color (e.g., Red). I am able to set the first object to Red with no problem. However when I go to set the second object to the same color, the SelectedColorChanged event is not firing. My guess is that the color is being saved on the control so when I click color a second time, it is not different.
Ideally, I would be able to set the color pallet to the color value of the object I am selecting so that when the color changes, the SelectedColorChanged event fires correctly because the color value is different. But I do not see a way to set a color value for the control.
I would appreciate any ideas as to how to accomplish my objective above. And if this is the wrong control, perhaps there is a different one I should be using. (I did like this one due to the variety of choices.
Hi Stephen,
We have created a sample for applying same color to many objects using SfColorPalette. Please refer the sample for your reference.
If we misunderstood your query, please provide sample or more information about the requirement.So, it will be helpful to prompt the solution further.
Regards,
Gokul T.
Thank you for the reply. However the issue I have is different than this. I am creating multiple nodes in a diagram. I then want to set the color for the first node to be Red; this works fine. I then go to the next node to set it to the same color; but when I do, nothing happens.
I have created a sample solution which replicates the issue in a very simple environment. Right-click on a table node (under the column headings) to bring up a context menu. Choose Format Table and then select a color, Right-click the second table and try to choose the same color. Nothing will happen.
Hi Stephen,
We have achieved your requirement by changing the value of the SfColorPalette in the SelectedColorChanged event.
Code Snippets
SfColorPalette palette = sender as SfColorPalette;
palette.SelectedColorChanged -= ColorPalette_SelectedColorChanged;
palette.SetValue(SfColorPalette.SelectedColorProperty, Colors.Transparent);
palette.SelectedColorChanged += ColorPalette_SelectedColorChanged;
Please refer to the sample for your reference
Regards,
Gokul T.