private void changeContent() { var list = ContentListView.ItemsSource <TimeStopListModel <StopGroup> >(); var selectedItem = list.FirstOrDefault(x => x.Stop == stop) ?? list.First(); int delta = Int32.Parse(selectedItem.Time); int n = 1, sgn = -1; foreach (var item in list) { item.Position = sgn * n++; item.Time = (Int32.Parse(item.Time) - delta).ToString(); if (item.Stop == selectedItem.Stop) { item.Position = 0; sgn = 1; } } }