xaml - how to apply Font.WeightBold for only one ListBoxitem in ListBox -


i binding listboxitems arraylist.this arraylist contains textbox , combobox text.now question how can make 1 listitem font bold through code not xaml..because not adding listbox items xaml.

any suggestion, idea implement this..

thanks in advance.

edit:

xaml:

   <listbox name="lstbx"  width="200" horizontalalignment="left" margin="0,0,0,0" borderbrush="transparent" > </listbox> 

code:

    private arraylist loadlistdata()     {          arraylist arrlist = new arraylist();                     //txtfullname.fontweight = fontweights.bold; //this didnt work         arrlist.add(txtfullname.text);         arrlist.add(" ");     }       lstbx.itemssource=loadlistdata(); 

i don't know if want i'm filling listbox textblocks , setting text content want. demonstration:

    private void makebold()     {         (int = 0; < 5; i++)         {             textblock s = new textblock();             s.text = "testing" + i;             if (i == 3)                 s.fontweight = fontweights.heavy;             lstbx.items.add(s);         }     } 

i result:

enter image description here

i hope helps.


Comments