c# - Windows phone app running out of memory -
currently view binds data in code behind, in order display pic, 2 subheadings, inside listbox. windows phone runs out of memory when load records. have made app load 10 records @ time, when user scrolls down, 10 more load etc. problem phone still runs out of memory when user loads 200 or more records, , there 2600 records.
<listbox x:name="geklassifisseerd_list" verticalalignment="top" itemssource="{binding classifiedads}" selectionchanged="geklassifisseerd_list_selectionchanged_1" grid.row="1"> <listbox.itemtemplate> <datatemplate> <stackpanel margin="5"> <image source="{binding imageurl}" height="140" width="160"/> <textblock text="{binding title}" textwrapping="wrap" margin="2" width="160" foreground="black" fontweight="bold" fontsize="15"/> <textblock text="{binding creationdate}" textwrapping="wrap" foreground="black" margin="2,0,0,5" fontsize="13"/> </stackpanel> </datatemplate> </listbox.itemtemplate> <itemscontrol.itemspanel> <itemspaneltemplate> <controls:wrappanel orientation="horizontal" /> </itemspaneltemplate> </itemscontrol.itemspanel>
the model :
public class classifiedads : inotifypropertychanged { public int id { get; set; } public string title { get; set; } private string _body; public string body { { return _body; } set { _body = htmlhelper.converthtmltotext(value); } } public string categoryname { get; set; } public string contactemail { get; set; } public string contacttel { get; set; } public datetime creationdate { get; set; } public datetime displayuntildate { get; set; } public gal gallery { get; set; } public string imageurl { get; set; } public bool isactive { get; set; } public bool isdeleted { get; set; } public datetime lastupdatedate { get; set; } public string physicaladdress { get; set; } public string price { get; set; } public string provincename { get; set; } public int totalviews { get; set; } public event propertychangedeventhandler propertychanged; private void raisepropertychanged(string propertyname) { if (this.propertychanged != null) { this.propertychanged(this, new propertychangedeventargs(propertyname)); } } }
i don't know how else can load data, since records need shown, possible unload previous records user scrolls down? or maybe else try?
Comments
Post a Comment