Exemplo n.º 1
0
        public SongListViewModel(SongRepository repo)
        {
            _songRepository = repo;
            _songs = new ObservableCollection<Song>(_songRepository.GetSongs());
            _songRepository.Dispose();
            MediaControl = new RelayCommand(new Action<object>(SendMediaControlMessage));

            // Listens for PlaylistListViewModel.cs to select a playlist
            Messenger.Default.Register<Playlist>(this, UpdateSongsList, "PlaylistSelected");

            Messenger.Default.Register<bool>(this, RefreshSongList, "SongUpdated");

            Messenger.Default.Register<bool>(this, CanPlaySongUpdate, "NoCredits");
        }
Exemplo n.º 2
0
        public SongListViewModel(SongRepository repo)
        {
            _songRepository = repo;
            _songs          = new ObservableCollection <Song>(_songRepository.GetSongs());
            _songRepository.Dispose();
            MediaControl = new RelayCommand(new Action <object>(SendMediaControlMessage));

            // Listens for PlaylistListViewModel.cs to select a playlist
            Messenger.Default.Register <Playlist>(this, UpdateSongsList, "PlaylistSelected");

            Messenger.Default.Register <bool>(this, RefreshSongList, "SongUpdated");

            Messenger.Default.Register <bool>(this, CanPlaySongUpdate, "NoCredits");
        }
Exemplo n.º 3
0
 public SongListViewModel(int playlistid)
 {
     _songRepository = new SongRepository(playlistid);
     _songs = new ObservableCollection<Song>(_songRepository.GetSongs());
 }
Exemplo n.º 4
0
 public SongListViewModel(int playlistid)
 {
     _songRepository = new SongRepository(playlistid);
     _songs          = new ObservableCollection <Song>(_songRepository.GetSongs());
 }