private void setContent() { Route route = routes[routeIndex]; if (stop == route.TravelRoute.Last().Stop) { this.stop = route.TravelRoute.First().Stop; } var list = route.TravelRoute .Select(e => new TimeStopListModel <StopGroup> { Time = e.Time.ToString(), Stop = e.Stop }) .ToList(); list.Last().Disabled = true; ContentListView.ItemsSource = list; changeContent(); int current = list.IndexOf(list.First(x => x.Position == 0)); int ind = Math.Max(0, current - 4); if (ind != 0) { ContentListView.ForceScrollIntoView(list[ind]); } }
private void ViewModel_ScrollIntoViewRequired(object sender, object scrollTargetItem) { ContentListView.ForceScrollIntoView(scrollTargetItem); }