Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

List view to carousel page bug with item index 1?

$
0
0

So i have a listview with an item select event:

storyList.ItemSelected += (sender, e) =>
            {
                if (e.SelectedItem == null) return;

                var list = (ListView)sender;
                var index = data.IndexOf((TopStoryCard)e.SelectedItem);

                //Navigation.PushAsync(new StoryDetails((TopStoryCard)e.SelectedItem));
                Navigation.PushAsync(new StoryCarousel(index));

                list.SelectedItem = null;
            };

which goes to :

public class StoryCarousel : CarouselPage
    {
        public StoryCarousel(int index)
        {
            var stories = Repo.GetStories();

            foreach (var story in stories)
            {
                Children.Add(new StoryDetails(story));
            }
            this.SelectedItem = Children[index];
        }
    }

It works just fine except that item index of 1 when clicked goes to blank page. All the others work fine i can even slide the carousel over to index 1 and see the page properly, but clicking on it doesnt work.

Tested on Android api 15 and api 19


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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