This issue currently applies Change set 70828 so please forgive if this bug has been fixed already. The reason I was using this change set is that I needed the bug fix for the LongListSelector not firing the ScrollingCompleted event.
I have some code which dynamically adds groups to a LongListSelector control. This is done by simply adding to an ObservableCollection. If you need to see some of my code then I could supply this but I followed the standard pattern for setting up a LongListSelector, mostly from this helpful blog post http://windowsphonegeek.com/articles/Dynamically-updating-a-data-bound-LongListSelector-in-Windows-Phone.
I had no issue in either the February or August releases, however with the November change set an ArgumentOutOfRangeException is being thrown within InsertNewGroups in LongListSelector.cs
Here's the relevant parts of the stack trace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource
at System.Collections.ObjectModel.Collection`1.Insert(Int32 index, LongListSelectorItem item)
at Microsoft.Phone.Controls.LongListSelector.InsertNewGroups(IList newGroups, Int32 newGroupsIndex)
at Microsoft.Phone.Controls.LongListSelector.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, Group`1 item)
at System.Collections.ObjectModel.Collection`1.Add(Group`1 item)
Thanks
Comments:
I have some code which dynamically adds groups to a LongListSelector control. This is done by simply adding to an ObservableCollection. If you need to see some of my code then I could supply this but I followed the standard pattern for setting up a LongListSelector, mostly from this helpful blog post http://windowsphonegeek.com/articles/Dynamically-updating-a-data-bound-LongListSelector-in-Windows-Phone.
I had no issue in either the February or August releases, however with the November change set an ArgumentOutOfRangeException is being thrown within InsertNewGroups in LongListSelector.cs
Here's the relevant parts of the stack trace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource
at System.Collections.ObjectModel.Collection`1.Insert(Int32 index, LongListSelectorItem item)
at Microsoft.Phone.Controls.LongListSelector.InsertNewGroups(IList newGroups, Int32 newGroupsIndex)
at Microsoft.Phone.Controls.LongListSelector.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, Group`1 item)
at System.Collections.ObjectModel.Collection`1.Add(Group`1 item)
Thanks
Comments:
This bug is already fixed if you install the toolkit via NuGet or compile from source. There is a seperate work item to update the download zip to include the latest fixes.