This project has moved and is read-only. For the latest updates, please go here.
1
Vote

LongListMultiSelector Crashes When ReBinding

description

Hi,

Longlistmultiselector crashes when bind a list or observablecollection to it. But it doesn't crash on first bind, only crashes on second. In my view, it's reason is list's count's changes.

Here is the crsah report;
System.ArgumentException: Value does not fall within the expected range. at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData) at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual) at System.Windows.UIElement.TransformToVisual(UIElement visual) at Microsoft.Phone.Controls.LongListMultiSelector.ApplyItemsState(State state, Boolean useTransitions) at Microsoft.Phone.Controls.LongListMultiSelector.OnIsSelectionEnabledChanged(DependencyPropertyChangedEventArgs e) at Microsoft.Phone.Controls.LongListMultiSelector.OnIsSelectionEnabledPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue) at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Microsoft.Phone.Controls.LongListMultiSelector.set_IsSelectionEnabled(Boolean value) at Microsoft.Phone.Controls.LongListMultiSelector.UpdateIsSelectionEnabled() at Microsoft.Phone.Controls.LongListMultiSelector.OnSelectionChanged(IList removedItems, IList addedItems) at Microsoft.Phone.Controls.LongListMultiSelector.OnSelectedItemsCollectionCleared(Object sender, ClearedChangedArgs e) at Microsoft.Phone.Controls.LongListMultiSelector.SelectedItemsList.ClearItems() at System.Collections.ObjectModel.Collection1.Clear() at Microsoft.Phone.Controls.LongListMultiSelector.OnItemsSourceChanged(Object oldValue, Object newValue) at Microsoft.Phone.Controls.LongListMultiSelector.OnItemsSourcePropertyChanged(Object sender, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue) at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation) at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp) at System.Windows.Data.BindingExpression.SendDataToTarget() at System.Windows.Data.BindingExpression.SourcePropertyChanged(PropertyPathListener sender, PropertyPathChangedEventArgs args) at System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(PropertyPathStep source) at System.Windows.PropertyAccessPathStep.RaisePropertyPathStepChanged(PropertyListener source) at System.Windows.CLRPropertyListener.SourcePropertyChanged(Object sender, PropertyChangedEventArgs args) at System.Windows.Data.WeakPropertyChangedListener.PropertyChangedCallback(Object sender, PropertyChangedEventArgs args) at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e) at Windows8.Common.Helpers.NotifyPropertyChanged.OnPropertyChanged(String propertyName) at Windows8.Common.Helpers.NotifyPropertyChanged.SetProperty[T](T& storage, T value, String propertyName) at Windows8.Common.ViewModels.BillPaymentViewModel.set_OsyId(List`1 value) at Windows8.Common.ViewModels.BillPaymentViewModel.d__ee.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Windows8.Common.ViewModels.BillPaymentViewModel.d__71.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Windows8.Common.ViewModels.CompanyMenu.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Windows8.Common.Helpers.DelegateCommandAsync.d__0.MoveNext()}
Are there any resolution for that?

Thanks.

comments