コード例 #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;
        }
コード例 #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);
        }