Hi,
We are using XamlColorPicker and it is working pretty well.
We have created our own template for ComboBox in WPF. In a page, all comboboxes looks with one theme and template but XamColorPicker looks different.
So we want to apply the same StaticResource template to the XamColorPicker. I tried it with Template = "{StaticResource templatename}" but that is not working.
I checked this post http://www.infragistics.com/community/forums/p/32549/177677.aspx#177677 but more or less I need to assign each property of template again to XamColorPicker.
Is there any better way of doing this with minimal changes?
Thanks in advance.
Regards,
Raj
Hello Raj,
Thank you for your post!
I have been looking into it. The XamColorPicker, consists of a ToggleButton and a ColorPickerDialog. The ColorPickerDialog is the popup, that appears when the ToggleButton is pressed. This is way a style for a ComboBox would not apply for the XamColorPicker. This can be seen by using a WPF spy tool like Snoop: http://snoopwpf.codeplex.com/.
Would you please provide me with further information about the changes you want to make for the template of the XamColorPicker, so I can research further this functionality for you?
Thank you for the provided information. Looking forward to hearing from you.
Hi Gergana,
Thank you very much for your reply and details about the color picker.
I am attaching an image of the combobox I am looking for.
Sorry, because of the code policies I can't post combobox template.
What we did is, we created a template for this combobox and in any WPF pages, we use something like:
<combobox .... Template = "{StaticResource MyCustomTemplate" />
This is like a 3D template. This is a control template and we have used Toggle Button, ContentPresenter and TextBox in this.
If XamColorPicker is mix of Toggle Button and Dialog, can we apply this template to ToggleButton only? Is it possible?
Thank you for the provided information. I have been looking into your post. The Template you are using for the ComboBoxes cannot be used for the XamColorPicker, sicne it is not a ComboBox.
If you want to change the Template you would have to create a new one for the XamColorPicker. On the following link you can see when are the styling points for the XamColorPicker: http://help.infragistics.com/Help/Doc/WPF/2012.2/CLR4.0/html/Designers_Guide_Styling_Points_for_xamColorPicker.html.
What I can suggest is to modify the default Template of the XamColorPicker. I have created a small sample application for you. In it I have added the default template for the XamColorPicker. In this template you would be able to find the ToggleButton, that represents the part, that you see when the dropdown of the XamColorPicker is not open.
In the sample you also would find the XamColorPickerToggleBtn, which is the Style, that is applied to the ToggleButton. You can modify it too, to meet your requirements.
Please find the attached sample application and feel free to let me know if you have any further questions on this matter.
Thank you very much for your reply and for the code.
I will check the styles for toggle button and color picker and see till what extent I can apply the 3-D styles of my existing combobox to that.
For now, I am good to go with the sample your have provided.
Thanks a ton for that and I will get back to you if I require any further information.
Thank you for the feedback. I am glad I was able to help. Please do not hesitate to let me know if you have any further question on this matter.