示例#1
0
        public static SinglePlaylistViewModel CreateSinglePlaylistViewModel
            (PlaylistViewModel playlist, Player.Player player, User user, PropertyChangedEventHandler callback)
        {
            SinglePlaylistViewModel singlePlaylistViewModel = new SinglePlaylistViewModel(playlist, player, user);

            singlePlaylistViewModel.PropertyChanged += callback;
            return(singlePlaylistViewModel);
        }
示例#2
0
        public PlaylistsViewModel(
            ISongLoader songLoader,
            IPlaylistRetriever playlistRetriever,
            IPlaylistHolder playlistHolder,
            UpdateCurrentPlaylistCommand updateCurrentPlaylistCommand,
            ShowCreatePlaylistDialogCommand showCreatePlaylistDialogCommand,
            SinglePlaylistViewModel singlePlaylistVm)
        {
            _songLoader                     = songLoader;
            _playlistRetriever              = playlistRetriever;
            PlaylistHolder                  = playlistHolder;
            UpdateCurrentPlaylistCommand    = updateCurrentPlaylistCommand;
            ShowCreatePlaylistDialogCommand = showCreatePlaylistDialogCommand;
            SinglePlaylistViewModel         = singlePlaylistVm;

            LoadPlaylists()
            .ContinueWith(task =>
            {
                MessageBox.Show(task.Exception.Message);
            }, TaskContinuationOptions.OnlyOnFaulted);
        }