예제 #1
0
        // needed for longlistMULTIselector only
        private void ScrollToPreviousLongListPosition()
        {
            var item = AppModel.CurrentScrollPosition();

            if (item != null)
            {
                // Trying to scroll to a nonexistent list item fails with an ArgumentException, so we suppress.
                // However, by checking MusicItems.Contains as above, this should never happen.
                // The item we try to scroll to may have been deleted, or the library may have been reset.
                // We could try to check whether the item exists in the selector, but it's not too easy.
                // Directly searching LongListSelector.ItemsSource will not work, because the items may be grouped.
                Utils.Suppress <Exception>(() => MusicItemLongListSelector.ScrollTo(item));
            }
        }