public MusicTreeViewModel(ILibraryRequestHandler requestHandler) : this() { this.requestHandler = requestHandler; SearchCommand = new SearchMusicTreeCommand(this); }
public override void LoadChildren(ILibraryRequestHandler dataManager) { base.LoadChildren(dataManager); switch (mode) { case ViewMode.Classic: foreach (Album album in dataManager.GenerateArtistAlbumList(_artist)) { Children.Add(new AlbumViewModel(album, this)); } break; case ViewMode.Simple: foreach (Song song in dataManager.GenerateArtistSongList(_artist)) { Children.Add(new SongViewModel(song, this)); } break; case ViewMode.Album: case ViewMode.MAX: default: throw new Exception($"Inappropriate view mode for an ArtistViewModel: {mode}"); } }
public override void LoadChildren(ILibraryRequestHandler dataManager) { base.LoadChildren(dataManager); foreach (DirectoryDTO data in dataManager.GetDirectories(Path)) { Children.Add(new DirectoryViewModel(data, this)); } foreach (Recording data in dataManager.GetDirectoryRecordings(Path)) { Children.Add(new RecordingViewModel(data, this)); } }
public override void LoadChildren(ILibraryRequestHandler dataManager) { base.LoadChildren(dataManager); if (Recording == null) { //SimpleView Artist artist = Parent.Data as Artist; foreach (Recording recording in dataManager.GenerateSongRecordingList(_song)) { Children.Add(new RecordingViewModel(recording, artist == recording.Artist, this)); } } else { //ClassicView & AlbumView foreach (Recording recording in dataManager.GenerateSongRecordingList(_song)) { Children.Add(new RecordingViewModel(recording, Recording == recording, this)); } } }
public override void LoadChildren(ILibraryRequestHandler dataManager) { base.LoadChildren(dataManager); if (Parent == null) { //Album View foreach (Recording recording in dataManager.GenerateAlbumRecordingList(_album)) { Children.Add(new SongViewModel(recording, true, this)); } } else { Artist artist = Parent.Data as Artist; //Classic View foreach (Recording recording in dataManager.GenerateAlbumRecordingList(_album)) { Children.Add(new SongViewModel(recording, recording.Artist == artist, this)); } } }