示例#1
0
        private void AddCustomAlbum(object obj)
        {
            var dialog = new TextBoxWindow();

            if (dialog.ShowDialog() == true)
            {
                var album = new CustomAlbum()
                {
                    Name = dialog.ResponseText
                };

                _musicLog.AddAlbum(album, SelectedArtist.Artist);
                ActiveAlbums.Add(new CustomAlbumViewModel(album));
            }
        }
示例#2
0
        private void AddCustomArtist(object obj)
        {
            var dialog = new TextBoxWindow();

            if (dialog.ShowDialog() == true)
            {
                var artist = new CustomArtist()
                {
                    Name = dialog.ResponseText
                };

                _musicLog.AddArtist(artist);
                ActiveArtists.Add(new CustomArtistViewModel(artist));
            }
        }
示例#3
0
        private void AddCustomTrack(object obj)
        {
            var dialog = new TextBoxWindow();

            if (dialog.ShowDialog() == true)
            {
                var track = new CustomTrack()
                {
                    Name    = dialog.ResponseText,
                    TrackNo = _musicLog.GetTracks(SelectedAlbum.Album).Count() + 1
                };

                _musicLog.AddTrack(track, SelectedAlbum.Album);
                ActiveTracks.Add(new CustomTrackViewModel(track));
            }
        }
        private void ChangePlaylistName(object obj)
        {
            var activePlaylist = SelectedPlaylist;
            var dialog         = new TextBoxWindow();

            if (dialog.ShowDialog() == true)
            {
                activePlaylist.Name = dialog.ResponseText;
            }

            int index = Playlists.IndexOf(activePlaylist);

            SelectedPlaylist = null;
            Playlists.Remove(activePlaylist);
            Playlists.Insert(index, activePlaylist);
            SelectedPlaylist = activePlaylist;
        }
        private void AddPlaylist(object obj)
        {
            var dialog   = new TextBoxWindow();
            var playlist = new PlaylistObject();

            if (dialog.ShowDialog() == true)
            {
                playlist.Name = dialog.ResponseText;
                if (String.IsNullOrWhiteSpace(playlist.Name))
                {
                    return;
                }
            }

            _musicLog.AddPlaylist(playlist);
            Playlists.Add(playlist);
        }