How to delete all the item from list in c# windows phone 8 -


hi working on windows phone chat application , have save user chat in local db , want clear conversation , not able delete chat , following code delete 1 item @ time following code using:

var del_chat = dbconndelete_user.query<savedmsg>("select * savedmsg                                chatuserid='" + totalseletion + "'").firstordefault(); dbconndelete_user.delete(del_chat); 

if want clear list, can this

  list<myclass> mylist = new slist<myclass>();   mylist.clear(); //remove elements list  

this work observablecollection too

observablecollection<myclass> myobservable = new observablecollection<myclass> (); myobservable.clear(); 

i suggest use observablecollection represents dynamic data collection provides notifications when items added, removed, or when whole list refreshed. reflected in user interface. pros of observable collection instead of list


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -