private void LoadList() { Guid?selectedTrackId = SelectedTrack?.Track.Id; var tracks = tracksProvider.Tracks.Select(t => new TrackListItemVM() { Track = t, Body = t.Body.Names.First(), StartDate = JulianDayToString(t.From), EndDate = JulianDayToString(t.To), Color = t.Color }); Tracks.Clear(); foreach (var track in tracks) { Tracks.Add(track); } if (selectedTrackId != null) { SelectedTrack = tracks.FirstOrDefault(t => t.Track.Id == selectedTrackId.Value); } NotifyPropertyChanged(nameof(NoTracks)); }
private void SelectTrack(TrackListItemVM t) { EditTrack(t.Track); }