public MediaResourceView(GrabbedMediaViewModel viewModel) { DataContext = viewModel; InitializeComponent(); var channels = GrabbedMedia.Media.Channels; DrawingPresenter icon; if (viewModel.IsComposition) { icon = iconCreate; btnCopyLink.IsVisible = false; ((TextBlock)btnDownload.Content).Text = "Download & convert"; } else { switch (channels) { case MediaChannels.Both: icon = iconCheck; break; case MediaChannels.Audio: icon = iconAudio; break; case MediaChannels.Video: icon = iconVideo; break; default: throw new NotSupportedException($"Media channel of {channels} is not supported."); } } icon.IsVisible = true; }
public MediaDownloader(GrabbedMediaViewModel grabbedViewModel, string targetPath, GrabResult grabResult) { _grabResult = grabResult; _viewModel = grabbedViewModel; _targetPath = targetPath; }
public Downloader(GrabbedMediaViewModel grabbedViewModel, string targetPath) { _viewModel = grabbedViewModel; _targetPath = targetPath; }