Ejemplo n.º 1
0
        public AddSongViewModel()
        {
            this.AddItemCommand = new RelayCommand(AddItem);

            this.ParentArtists = new ObservableCollection <ARTISTS>(MusicStructureHelper.GetArtists());
            this.ParentAlbums  = new ObservableCollection <ALBUMS>();
        }
Ejemplo n.º 2
0
        private void GetItems()
        {
            MusicStructureHelper.InitializeDB();

            var children = MusicStructureHelper.GetArtists();

            this.Items = new ObservableCollection<MusicItemViewModel>(children.
                Select(x => new MusicItemViewModel(ItemTypeEnum.Artist, x.Name, x.ID)));
        }
Ejemplo n.º 3
0
 private void AddItem()
 {
     if (SelectedAlbum != null)
     {
         MusicStructureHelper.AddSong(SelectedAlbum.ID, SongName);
     }
     else
     {
         MessageBox.Show("Please select album or artist", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
Ejemplo n.º 4
0
        private void Expand()
        {
            switch (this.Type)
            {
            case ItemTypeEnum.Song:
                return;

            case ItemTypeEnum.Album:
                var songs = MusicStructureHelper.GetAlbumsSongs(this.ID);
                this.Children = new ObservableCollection <MusicItemViewModel>(songs.
                                                                              Select(x => new MusicItemViewModel(ItemTypeEnum.Song, x.Name, x.ID)));
                break;

            case ItemTypeEnum.Artist:
                var albums = MusicStructureHelper.GetArtistsAlbums(this.ID);
                this.Children = new ObservableCollection <MusicItemViewModel>(albums.
                                                                              Select(x => new MusicItemViewModel(ItemTypeEnum.Album, x.Name, x.ID)));
                break;
            }
        }