private void CreatePlaylist(Object obj)
        {
            PlaylistRepository tempRepo = new PlaylistRepository();
            tempRepo.Dispose();

            ObservableCollection<Song> tempSongs = new ObservableCollection<Song>(SelectedSongs);
            Playlist newPlaylist = new Playlist();
            newPlaylist.Title = Name;
            newPlaylist.Image = PathHelper.GetRelativePath(SelectedImage, Directory.GetCurrentDirectory() + "\\");
            newPlaylist.Songs = tempSongs;
            newPlaylist.UserID = PlaylistForAll ? 0 : User.ID;

            tempRepo.AddNewPlaylist(newPlaylist, newPlaylist.UserID);

            //Listened to by mainviewmodel
            Messenger.Default.Send<bool>(true, "CloseCreatePlaylistView");
        }
Esempio n. 2
0
        private void CreatePlaylist(Object obj)
        {
            PlaylistRepository tempRepo = new PlaylistRepository();

            tempRepo.Dispose();

            ObservableCollection <Song> tempSongs = new ObservableCollection <Song>(SelectedSongs);
            Playlist newPlaylist = new Playlist();

            newPlaylist.Title  = Name;
            newPlaylist.Image  = PathHelper.GetRelativePath(SelectedImage, Directory.GetCurrentDirectory() + "\\");
            newPlaylist.Songs  = tempSongs;
            newPlaylist.UserID = PlaylistForAll ? 0 : User.ID;

            tempRepo.AddNewPlaylist(newPlaylist, newPlaylist.UserID);

            //Listened to by mainviewmodel
            Messenger.Default.Send <bool>(true, "CloseCreatePlaylistView");
        }