private void addNewSlide() { var index = DateListCarousel.Position; if (index == DateList.Count() - 1) { DateList.Add(new DateItem { Date = DateList[index].Date.AddDays(1), Text = WicketHelper.ConvertDate(DateList[index].Date.AddDays(1)), MatchList = WicketHelper.GetMatchList(DateList[index].Date.AddDays(1)), Loading = false, }); } else if (DateListCarousel.Position == 0) { DateList.Insert(0, new DateItem { Date = DateList[index].Date.AddDays(-1), Text = WicketHelper.ConvertDate(DateList[index].Date.AddDays(-1)), MatchList = WicketHelper.GetMatchList(DateList[index].Date.AddDays(-1)), Loading = false, }); } }
private void addNextSlide() { int index; if (DateListCarousel.Position == DateList.Count() - 1) { index = DateList.Count() - 1; DateList.Add(new DateItem { Date = DateList[index].Date.AddDays(1), Text = WicketHelper.ConvertDate(DateList[index].Date.AddDays(1)), MatchList = WicketHelper.GetMatchList(DateList[index].Date.AddDays(1)), }); DateListCarousel.Position = index + 1; } else { index = DateListCarousel.Position + 1; DateListCarousel.Position = DateListCarousel.Position + 1; } DateLabel.Text = WicketHelper.ConvertDate(DateList[index].Date); }