Exemple #1
0
 public SettingsViewModel(IFileService fileService, IDialogService dialogService,
                          IThemeResolver themeResolver, IDownloadOptionProvider optionProvider,
                          IUpdateChecker updateChecker, YtdlUpdateService ytdlUpdateService)
 {
     this.FileService            = fileService;
     this.dialogService          = dialogService;
     this.themeResolver          = themeResolver;
     this.updateChecker          = updateChecker;
     this.YoutubeDLUpdateService = ytdlUpdateService;
     DefaultFormats         = new ObservableCollection <IDownloadOption>(optionProvider.CreateDownloadOptions());
     SwitchAppThemeCommand  = new RelayCommand(() => SwitchAppTheme());
     UpdateVividlCommand    = new RelayCommand(() => UpdateVividl());
     UpdateYoutubeDLCommand = new RelayCommand(async() => await UpdateYoutubeDL());
 }
Exemple #2
0
        public SettingsViewModel(IFileService fileService, IDialogService dialogService,
                                 IThemeResolver themeResolver, IDownloadOptionProvider optionProvider)
        {
            this.FileService      = fileService;
            this.dialogService    = dialogService;
            this.themeResolver    = themeResolver;
            this.updateChecker    = SimpleIoc.Default.GetInstance <IUpdateChecker>();
            DefaultFormats        = new ObservableCollection <IDownloadOption>(optionProvider.CreateDownloadOptions());
            SwitchAppThemeCommand = new RelayCommand(() => SwitchAppTheme());
            var ydl = SimpleIoc.Default.GetInstance <YoutubeDLSharp.YoutubeDL>();

            YoutubeDLUpdateService = new YtdlUpdateService(ydl);
            UpdateVividlCommand    = new RelayCommand(() => UpdateVividl());
            UpdateYoutubeDLCommand = new RelayCommand(async() => await UpdateYoutubeDL());
        }