I love having the sources to the WindowsPhone Toolkit (http://silverlight.codeplex.com/releases/view/52297) available, since you can not only learn how something works, you can also fix "issues".  (I won't call them bugs, just unplanned features)

Case in point: I ran into an issue using the LoopingSelector to create the "Choose Book and Chapter" page in my Bible program for WindowsPhone 7.

The secondary (chapter) selector ranges from 1 to 150 depending upon the primary selector (book of the bible).  But if the number of items in the secondary selector decreases, it seemed to "stick" there, so that if you go from a book with 6 chapters to a book with 4 chapters and back to a book with 6 chapters, you can't select chapters 5 or 6 anymore.

Turns out that the LoopingSelector isn't resetting it's scrolling amounts when it updates data.

If this is happening to you, try the following modification to LoopingSelector.UpdateData()

        private void UpdateData()

{

if (!IsReady)

{

return;

}



// Save all items

_temporaryItemsPool = new Queue<LoopingSelectorItem>(_itemsPanel.Children.Count);

foreach (LoopingSelectorItem item in _itemsPanel.Children)

{

if (item.GetState() == LoopingSelectorItem.State.Selected)

{

item.SetState(LoopingSelectorItem.State.Normal, false);

}

_temporaryItemsPool.Enqueue(item);

item.Remove();

}



_itemsPanel.Children.Clear();

_panelStoryboard.Stop();

_panningTransform.Y = 0;



_minimumPanelScroll = float.MinValue;

_maximumPanelScroll = float.MaxValue;



Balance();

}


That fixed it for me.

Update: I meant to update this awhile ago, but I've been informed that the next release of the toolkit will include this fix.