I am new to wpf. Actually, I am a style ComboBoxthat gets data from a database.
ComboBoxworks great at this point without style.
I edited the ControlTemplatecontrol ComboboxItemin the stylesheet, for example, in the resource dictionary.
If Styleapplied to ComboBoxwith static data, the style works fine. But if the style is applied to ComboBoxwith dynamic data (database binding in this case), the list of elements returns an object only (the elements shown are similar to "Class.Method.Property"), but not the content property that I need to show.
I tried everything and I read everything on the web about xaml styles and templates ComboBox, but I could not solve the problem.
My ContentPresenterlooks like it returns a data binding object:
<ContentPresenter
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
Content="{TemplateBinding ContentControl.Content}"/>
Can anybody help me?
source
share