Ejemplo n.º 1
0
        public EditPodcastViewModel(PodcastViewModel podcast)
        {
            Podcast = podcast;

            _dialogResult = null;

            _acceptCommand = new DelegateCommand(ExecuteAcceptCommand, CanExecuteAcceptCommand);

            NamingStyles = CollectionHelper.CreateForDefaultableEnum <PodcastEpisodeNamingStyle>();

            DownloadStrategies = CollectionHelper.CreateForDefaultableEnum <PodcastEpisodeDownloadStrategy>();

            Podcast.PropertyChanged += PodcastPropertyChanged;
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
        private bool EditPodcast(PodcastViewModel podcast)
        {
            podcast.StartEditing();

            var acceptedEdit = _dialogService.ShowEditPodcastDialog(podcast);

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

            return(acceptedEdit);
        }