c# - How to get multiple selected checkbox in listView in windows 8.1? -


i have developed windows 8.1 app using c#. have created textblock, when user taps on it, opening flyout contains listview selectionmode multiple. now, listview data template contains checkbox,which showing user, don't know how multiple checkbox selected user , populate selected items comma seperated. data template listview below

<datatemplate x:key="defaultselectlistitemtemplate">     <stackpanel>         <textblock content="{binding value}"                    horizontalalignment="stretch"                    verticalalignment="stretch"                    margin="12,0,0,0"                    foreground="black"/>     </stackpanel> </datatemplate>  

please suggest, how can use checkbox.ischecked property here selected items , show in textblock.

update

mylist.selectionchanged += (sender1, args1) => {     list<ilookup> selectedlookup = lookuplist.selecteditems.oftype<ilookup>().tolist();     textblock.text=string.join(",", selectedlookup.select(lookup => lookup.i_lu_answer).tolist());     checkboxflyout.hide(); }; 

listview have checkbox in itemcontainerstyle shouldn't use checkbox in datatemplate. instead of should retemplte itemcontainerstyle make checkbox standout, selected items mylistbox.selecteditems

<listview x:name="mylistbox" selectionmode="multiple" selectionchanged="onselectionchanged">     <listview.itemtemplate>        <datatemplate>            <textblock text="{binding value}"/>        </datatemplate>     </listview.itemtemplate> </listview> 

Comments