private void lvContextTrack_Edit(object sender, RoutedEventArgs e) { if (Library is null || lvTracks.SelectedIndex == -1) { return; } var dialog = new TrackEditWindow((Track)lvTracks.SelectedItem); dialog.ShowDialog(); }
private void lvContextTrack_AddNew(object sender, RoutedEventArgs e) { if (Library is null || lvTracks.SelectedIndex == -1) { return; } var entry = new Track(); var dialog = new TrackEditWindow(entry, isSequence: Library.Type == MusicInf.PlaylistType.SEQ); dialog.ShowDialog(); if (dialog.Saved) { var currentPlaylist = ((Track)lvTracks.SelectedItem).ParentPlaylist; currentPlaylist.AddTrack(entry); entry.ParentPlaylist = currentPlaylist; UpdatePlaylistsList(); } }