I would like to re-template the color picker button which launches the popup.
In the screenshot below, I'm using the WPF Ribbon control, and I want my Font Colour button to launch the ColorPicker popup directly, rather than the current 2-step process. I figure the two ways to achieve this would be either embed the ColorPicker popup in my WPF RibbonMenuButton directly; or I could retemplate the ColorPicker button to match my current Font Colour button styling. I'd say the first option would be preferable, but the second option would at least achieve what I need.
Any suggestions as to how to do this?
Thanks.
One option is to override the default template of the XamColorPicker and remove the ToggleButton and the CololPickerDialog controls from the main grid (Root) and then place the RootPopupElement border directly as a child of the grid. You could also remove the Popup because is not needed.
In order to host the XamColorPicker in the MenuItem you can use one of the two approaches described in this forum thread.
Attached is a sample project that illustrates this implementation. Let me know if this is what you need.
Just following up on this thread. Let me know if I can be of any further assistance.
Hi,
I have this exact issue with using your colorpicker in SILVERLIGHT. I have taken your advice above, and moved the popup etc. It works except now the Advanced button throws an error, saying object reference is not set to an instance of an object when the command is fired.
Any help greatly appreciated.
Thanks,
Richard
Sorry, you can ignore my post above. I realised that as well as deleting the popup I had also deleted this line:
<igPrim:ColorPickerDialog x:Name="ColorPickerDialog" ColorPicker="{Binding RelativeSource={RelativeSource TemplatedParent}}"/>
which is obviously the advanced dialog window!