Hi Guys,
I'm using XamColorPicker to apply background color on ActiveCell of XamDataGrid.
The behaviour is - XamColorPicker is applying the color, to the ActiveCell of the xamdatagrid, on MouseOver on colors in XamColorPicker, rather I want the color to applied on Click of color from XamColorPicker and not mouseover,This should be the appropriate behaviour which i'm looking for.
I hope the situation is clear.
Kindly Help,
Thanks,
Arun
The SelectedColor is designed to change as you mouse over, this was done so that their wouldn't be two events, one listing the dynamic, not fully resolved color changing and the hard color selection.
So for this case you would probably have to listen to the drop down closing and set your color at that point rather then binding to the selected color.
Hello Kress,
I am handling the dropdownclosing event but when setting my control's color to colorpicker's selected color it also create problem.
works ok if i choose some color from color picker but if i only hover some colors and click outside the color picker, its dropdownclosing event calls and it bind the last hoverd color from colorpicker (because the selected color is still the last hovered color).
what should i do now?
Hello Tarun,
You can use a Dispatcher in the XamColorPicker's DropDownClosing event handler in order to get the correct color like this:
Dispatcher.BeginInvoke(new Action(() => { //(sender as XamColorPicker).SelectedColor }), System.Windows.Threading.DispatcherPriority.Background, null);
Hope this helps you.
Hey Stefan,
Thanks a lot, it worked, but now again a problem.
When i pick color from Advanced Editor option. it doesn't change the color.
Now what should i do for this.
I believe that this behavior is expected, because when you click the Advanced button the DropDownClosing event fires and you set the color. Then you select a new color, but this time the DropDownClosing event doesn't fire. The thing you can do is to handle the XamColorPicker's SelectedColorChanged and use a flag to determine whether the drop down was fired and if it was then in the SelectedColorChanged event you can set the color.