Quantcast
Channel: Silverlight Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 801

Closed Issue: Phone Toolkit: MultiSelectList throws ArgumentOutOfRangeException if IsSelectionEnabled is true on page navigation return [9744]

$
0
0
<p>In case you're wondering, I'm running changeset 70828 so not quite the August toolkit.</p>
<p>&#160;</p>
<p>I ran into this issue because I have an AppBar button bound to just toggle IsSelectionEnabled. If you tap the button, leave the multiselectlist in the &quot;select items but nothing is selected&quot; state, navigate away from the page, then come back you get a lovely exception with the following exception message/stacktrace:</p>
<p>&#160;</p>
<p>Specified argument was out of the range of valid values.</p>
<p>Parameter name: childIndex</p>
<p> at System.Windows.Media.VisualTreeHelper.GetChild(DependencyObject reference, Int32 childIndex)</p>
<p> at Microsoft.Phone.Controls.ItemsControlExtensions.GetItemsInViewPort(ItemsControl list)</p>
<p> at Microsoft.Phone.Controls.MultiselectList.OpenSelection()</p>
<p> at Microsoft.Phone.Controls.MultiselectList.OnIsSelectionEnabledPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)</p>
<p> at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)</p>
<p> at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry&amp; newEntry, ValueOperation operation)</p>
<p> at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)</p>
<p> at System.Windows.Data.BindingExpression.RefreshExpression()</p>
<p> at System.Windows.Data.BindingExpression.SendDataToTarget()</p>
<p> at System.Windows.Data.BindingExpression.SourceAcquired()</p>
<p> at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)</p>
<p> at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)</p>
<p> at System.Windows.FrameworkElement.OnTreeParentUpdated(DependencyObject newParent, Boolean bIsNewParentAlive)</p>
<p> at System.Windows.DependencyObject.UpdateTreeParent(IManagedPeer oldParent, IManagedPeer newParent, Boolean bIsNewParentAlive, Boolean keepReferenceToParent)</p>
<p> at MS.Internal.FrameworkCallbacks.ManagedPeerTreeUpdate(IntPtr oldParentElement, IntPtr parentElement, IntPtr childElement, Byte bIsParentAlive, Byte bKeepReferenceToParent, Byte bCanCreateParent)</p>
<p> at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single&amp; outWidth, Single&amp; outHeight)</p>
<p> at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)</p>
<p> at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)</p>
<p> at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize)</p>
<p> at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double&amp; outWidth, Double&amp; outHeight)</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Workaround: in your OnNavigatedFrom event in either the page code-behind or your ViewModel in my case, set IsSelectionEnabled = false. A bound VM properly fires the property change so that the next time you come back the control is in the proper default state.</p>
<p>&#160;</p>
<p>You could say this is an extension of the certification requirement to unselect any item used for navigation in a list. I don't mind this workaround as it's rather minor but I suspect the control can probably handle that exception for us.</p>
Comments:

Closing all issues marked as fixed, dupe or no repro for the Windows Phone Toolkit September 2012 release.


Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>