예제 #1
0
        public PlaylistListViewModel(PlaylistRepository repo)
        {
            _playlistRepository = repo;
            _playlists = new ObservableCollection<Playlist>(_playlistRepository.GetStoredPlaylists());
            _playlistRepository.Dispose();

            // Listens for main view model, if a playlist is successfully added to database
            Messenger.Default.Register<bool>(this, UpdatePlaylistList, "UpdatePlaylistListView");
        } 
예제 #2
0
        public PlaylistListViewModel(PlaylistRepository repo)
        {
            _playlistRepository = repo;
            _playlists          = new ObservableCollection <Playlist>(_playlistRepository.GetStoredPlaylists());
            _playlistRepository.Dispose();

            // Listens for main view model, if a playlist is successfully added to database
            Messenger.Default.Register <bool>(this, UpdatePlaylistList, "UpdatePlaylistListView");
        }
예제 #3
0
 private void UpdatePlaylistList(bool truth)
 {
     if (truth)
     {
         //_playlistRepository.Dispose();
         _playlistRepository.StoreAllPlaylists();
         if (User != null)
         {
             _playlistRepository.StoreUserPlaylists(User.ID);
         }
         Playlists = new ObservableCollection <Playlist>(_playlistRepository.GetStoredPlaylists());
         _playlistRepository.Dispose();
         OnPropertyChanged("Playlists");
     }
 }
예제 #4
0
 public PlaylistListViewModel()
 {
     _playlistRepository = new PlaylistRepository();
     _playlists = new ObservableCollection<Playlist>(_playlistRepository.GetStoredPlaylists());
     _playlistRepository.Dispose();
 }
예제 #5
0
 public PlaylistListViewModel()
 {
     _playlistRepository = new PlaylistRepository();
     _playlists          = new ObservableCollection <Playlist>(_playlistRepository.GetStoredPlaylists());
     _playlistRepository.Dispose();
 }