public EditPodcastViewModel(PodcastViewModel podcast)
        {
            Podcast = podcast;

            _dialogResult = null;

            _acceptCommand = new DelegateCommand(ExecuteAcceptCommand, CanExecuteAcceptCommand);

            NamingStyles = CollectionHelper.CreateForDefaultableEnum <PodcastEpisodeNamingStyle>();

            DownloadStrategies = CollectionHelper.CreateForDefaultableEnum <PodcastEpisodeDownloadStrategy>();

            Podcast.PropertyChanged += PodcastPropertyChanged;
        }
Пример #2
0
        private void ExecuteAddPodcastCommand(object parameter)
        {
            var dataObject = parameter as IDataObject;

            var newPodcast = (dataObject != null)
                                 ? CreateNewPodcast(_dataObjectUriExtractor.GetUri(dataObject))
                                 : CreateNewPodcast(_clipboardService.GetText());

            var newPodcastViewModel = new PodcastViewModel(newPodcast);

            if (EditPodcast(newPodcastViewModel))
            {
                Podcasts.Add(newPodcastViewModel);
            }
        }
Пример #3
0
        private bool EditPodcast(PodcastViewModel podcast)
        {
            podcast.StartEditing();

            var acceptedEdit = _dialogService.ShowEditPodcastDialog(podcast);

            if (acceptedEdit)
            {
                podcast.AcceptEdit();
            }
            else
            {
                podcast.CancelEdit();
            }

            return(acceptedEdit);
        }