CollectionView/ListView & Checkbox Problem
In an app I am building I have around 260 items in a CollectionView and each of these has a Checkbox in their template, but this always causes an INSUFFICIENT MEMORY error. To dig into why this is, I pulled down this project and replicated my designs within it with the VerticalListPage.xaml page.
If I stubbed in 300 Monkey objects and ran that app and viewed the VerticalListPage, it loaded just fine. I did a lot of trial and error until I came across the fact that I'm using Checkboxes and this application isn't. As soon as I added a Checkbox, I was able to reproduce the issue so I think there is a serious issue with Checkboxes being used in CollectionList and ListView layouts.
These are the only changes I made and I would imagine this really should be working without issue. (In fact without using checkboxes, the memory usage can go a lot higher without throwing insufficient memory exception).
CollectionViewDemos\Views\Layout\VerticalListPage.xaml Line 31 add
<CheckBox/>
CollectionViewDemos\ViewModels\MonkeysViewModel.cs Line 71 add
for(int i=0; i<300; i++) { source.Add(new Monkey() { Name = i.ToString(), Location = i.ToString(), Details = i.ToString(), ImageUrl = i.ToString() }); }
This results in the application crashing with an exception of insufficient memory. I would really expect this to work however. If you take that <Checkbox /> element out of the xaml page, it will operate exactly as intended and without issue (and with greater memory usage).
Justin