binding - BindingExpression path error itemtemplate -


i using following itemtemplate in tabcontrol set content of tab item , foreground color of tab item. both properties available in same viewmodel class:

       <tabcontrol.itemtemplate>             <datatemplate>                 <dockpanel>                     <contentpresenter                          content="{binding path=name, updatesourcetrigger=propertychanged}"                         textelement.foreground="{binding path=color, converter={converter:colortobrushconverter}, updatesourcetrigger=propertychanged}"/>                 </dockpanel>             </datatemplate>         </tabcontrol.itemtemplate> 

as 'name' property works expected. when property modified name on tab item changes. 'color' property not work. keep getting

system.windows.data error: 40 : bindingexpression path error: 'color' property not found on 'object' ''string' (hashcode=2145491359)'. bindingexpression:path=color; dataitem='string' (hashcode=2145491359); target element 'contentpresenter' (name=''); target property 'foreground' (type 'brush')

when setting textelement.foreground constant color, e.g. "white", works.

what's wrong binding?


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -