c# - Populate ComboBox from code behind -


i have following in silverlight xaml:

<usercontrol........ <scrollviewer grid.row="2">         <listbox x:name="lblist">             <listbox.itemtemplate>                 <datatemplate>                     <grid horizontalalignment="stretch" >                         <grid.columndefinitions>                             <columndefinition width="auto"/>                             <columndefinition width="auto"/>                         </grid.columndefinitions>                         <image source="images/bild1.png" grid.column="0"/>                         <combobox name="mycombobox" grid.column="1"></combobox>                     </grid>                 </datatemplate>             </listbox.itemtemplate>         </listbox>     </scrollviewer>     .............  </usercontrol> 

and in code behind:

  static dictionary<string, string> dictdoctypes 

wich populate data. how show data inside mycombobox?

way 1 put loaded event on combo. in typecast sender combobox , populate data in it.

way 2 (pure mvvm)
attach command event. read here. pass self (combo) in it. in vm command, typecast parameter object combo , populate it.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -