windows phone 8 - How to Delete Item from Observable collection in C# -


i working on windows phone app , want delete item listbox.

i using following code list numbers=new list();

 observablecollection<string> mycollection = new observablecollection<string>(numbers);         int indexperson = listbox1.selectedindex;         mycollection.removeat(indexperson);         var = (observablecollection<string>)listbox1.itemssource;         listbox1.itemssource=my; 

and when click on delete button 1 item deleted based on index , when delete item deleted item show , current deleted item deleted.

how can delete items?

if want clear items can use

mycollection.clearitems() 

if want remove selected item use

 mycollection.remove(listbox1.selecteditem) 

Comments

Popular posts from this blog

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

node.js - Using Node without global install -

java - JavaScript + Thymeleaf - select onchange -