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"); }
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"); }
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"); } }
public PlaylistListViewModel() { _playlistRepository = new PlaylistRepository(); _playlists = new ObservableCollection<Playlist>(_playlistRepository.GetStoredPlaylists()); _playlistRepository.Dispose(); }
public PlaylistListViewModel() { _playlistRepository = new PlaylistRepository(); _playlists = new ObservableCollection <Playlist>(_playlistRepository.GetStoredPlaylists()); _playlistRepository.Dispose(); }