Exemplo n.º 1
0
        private CPlaylistVM(CPlaylist playlist, CPlaylistVM parent)
        {
            _parent   = parent;
            _playlist = playlist;

            UpdateChildren();
        }
Exemplo n.º 2
0
        void DoSelectionChanged(object selectedPlaylist)
        {
            CPlaylistVM pl = selectedPlaylist as CPlaylistVM;

            if (pl != SelectedPlaylist)
            {
                bool clear = true;
                SelectedPlaylist = pl;
                if (SelectedPlaylist != null)
                {
                    if (!SelectedPlaylist.IsFolder)
                    {
                        CTracks tracks = CTracksBroker.LoadTracks(SelectedPlaylist.Playlist.Tracks);
                        _tracks = null;
                        _tracks = new ObservableCollection <CTrack>(tracks.Tracks);
                        clear   = false;
                    }
                }
                if (clear)
                {
                    _tracks = null;
                }
                OnPropertyChanged("Tracks");
            }
        }
Exemplo n.º 3
0
 void DoShuffleCommand()
 {
     if (SelectedPlaylist != null)
     {
         CPlaylistVM pl = SelectedPlaylist;
         pl.Playlist = iTunesUtil.ShufflePlayList(pl.Playlist);
         pl.UpdateChildren();
         DoSelectionChanged(null);
         DoSelectionChanged(pl);
     }
 }
Exemplo n.º 4
0
        public MainWindowVM(CPlaylist rootPlaylist)
        {
            _rootPlaylist = new CPlaylistVM(rootPlaylist);

            _playlists = new ObservableCollection <CPlaylistVM>(_rootPlaylist.Children);
            //_playlists = new ObservableCollection<CPlaylistVM>(
            //    new CPlaylistVM[]
            //    {
            //        _rootPlaylist
            //    });
            InitCommands();
        }