private void lvContextTrack_Edit(object sender, RoutedEventArgs e) { if (Library is null || lvTracks.SelectedIndex == -1) { return; } var dialog = new BGMLTrackEditWindow((BGMLTrack)lvTracks.SelectedItem); dialog.ShowDialog(); if (dialog.Saved) { UpdateTrackList(); } }
private void lvContextTrack_AddNew(object sender, RoutedEventArgs e) { if (Library is null) { return; } var entry = new BGMLTrack(); var dialog = new BGMLTrackEditWindow(entry); dialog.ShowDialog(); if (dialog.Saved) { entry.Index = Library.Tracks.Count; Library.Tracks.Add(entry); UpdateTrackList(); } }