c# - Many entries with OnItemsChanged(), how to delete old entries -
i new xaml. entries added scrolling view , event change. there many entries being logged causing memory consumption. how delete entries entered earlier. , entries on deletion should not appear in scroll view too. in advance.
here xaml
<local:scrollinglv x:name="logview" width="300" height="100" margin="10,0,10,10" itemssource="{binding logmsg}">
here code adds scroll view
public partial class scrollinglv : listview { protected override void onitemschanged(system.collections.specialized.notifycollectionchangedeventargs e) { if (e.newitems != null) { int icount = e.newitems.count; if (icount > 0) { this.scrollintoview(e.newitems[icount - 1]); } } base.onitemschanged(e); } }
if using observablecollection, simple removing item listview
for example can refer msdn entry https://msdn.microsoft.com/en-us/library/ms748365(v=vs.110).aspx
Comments
Post a Comment