private void RewriteItinerary() { Itinerary.Clear(); Itinerary.Add(String.Format("{0,-20} {1,20} {2,20}", "Stacja", "Przyjazd", "Odjazd")); int k = 0; for (int i = 0; i < stations.Count; i++) { if (i == 0) { Itinerary.Add(string.Format("{0,-20} {1,20} {2,20}", stations[i], "", startDate.ToShortTimeString())); } else if (i == stations.Count - 1) { Itinerary.Add(string.Format("{0,-20} {1,20} {2,20}", stations[i], startDate.AddMinutes(times[k++]).ToShortTimeString(), "")); } else { Itinerary.Add(string.Format("{0,-20} {1,20} {2,20}", stations[i], startDate.AddMinutes(times[k++]).ToShortTimeString(), startDate.AddMinutes(times[k++]).ToShortTimeString())); } } NotifyOfPropertyChange("CanDelete"); NotifyOfPropertyChange("CanAddConnection"); }