c# - how to change listBox item font colour from code behind -


i have tried access listbox items properties this:

mylistbox.items[0]  

and set foreground property unknow me reason cant access way. can using code behind - , if yes - how?

implement itemtemplate , bind brush foreground property.

you should implement inotifypropertychanged in binding object , notify on mycolorbrush value change.

<listbox itemssource="{binding myitems}">     <listbox.itemtemplate>         <datatemplate>             <textblock text="{binding mytext}" foreground="{binding mycolorbrush}"/>         </datatemplate>     </listbox.itemtemplate> </listbox> 

Comments

Popular posts from this blog

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

What Are The Best Universities In The World?

Why People Get Naked Before Freezing To Death