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.
Hi,
Using your sample when I try to add the advanced button its crashing the app. Please let me know what needs to be done to resolve this issue.
thanks
nthaha
There isn't much to go on to what might be your problem. What is the crash? Can you post your demo project so we can see what you are doing? What is the exception?