public SettingsWindow([NotNull] SettingsWindowViewModel settingsWindowViewModel, [NotNull] WpfSettings wpfSettings, [NotNull] WindowExtensions windowExtensions, [NotNull] IDoWorkOnUi doWorkOnUi) { DataContext = settingsWindowViewModel; _wpfSettings = wpfSettings; _windowExtensions = windowExtensions; _doWorkOnUi = doWorkOnUi; Task.Run(async() => await _windowExtensions.StartOnSelectedWindow(this, _wpfSettings)); InitializeComponent(); }
public UpdateDataWindow([NotNull] UpdateDataViewModel updateDataViewModel, [NotNull] WpfSettings wpfSettings, [NotNull] IDoWorkOnUi doWorkOnUi, [NotNull] WindowExtensions windowExtensions) { _updateDataViewModel = updateDataViewModel; _updateDataViewModel.ParentWindow = this; DataContext = _updateDataViewModel; _wpfSettings = wpfSettings; _doWorkOnUi = doWorkOnUi; _windowExtensions = windowExtensions; Task.Run(async() => await _windowExtensions.StartOnSelectedWindow(this, _wpfSettings)); InitializeComponent(); }
public MainWindowViewModel ( [NotNull] IYouTubeCleanupToolDbContextFactory youTubeCleanupToolDbContextFactory, [NotNull] IMapper mapper, [NotNull] IGetAndCacheYouTubeData getAndCacheYouTubeData, [NotNull] IUpdateDataViewModel updateDataViewModel, [NotNull] IWindowService windowService, [NotNull] IErrorHandler errorHandler, [NotNull] IDoWorkOnUi doWorkOnUi, [NotNull] IDebugSettings debugSettings, [NotNull] ILogger logger ) { _youTubeCleanupToolDbContextFactory = youTubeCleanupToolDbContextFactory; Videos = new ObservableCollection <WpfVideoData>(); Playlists = new ObservableCollection <WpfPlaylistData>(); VideoFilter = new ObservableCollection <VideoFilter>(); _mapper = mapper; _getAndCacheYouTubeData = getAndCacheYouTubeData; CheckedOrUncheckedVideoInPlaylistCommand = new RunMethodCommand <WpfPlaylistData>(async o => await UpdateVideoInPlaylist(o), errorHandler.HandleError); OpenPlaylistCommand = new RunMethodCommand <PlaylistData>(OpenPlaylist, errorHandler.HandleError); OpenChannelCommand = new RunMethodCommand <VideoData>(OpenChannel, errorHandler.HandleError); OpenVideoCommand = new RunMethodCommand <VideoData>(OpenVideo, errorHandler.HandleError); SearchCommand = new RunMethodWithoutParameterCommand(Search, errorHandler.HandleError); RefreshDataCommand = new RunMethodWithoutParameterCommand(UpdateAllPlaylists, errorHandler.HandleError); UpdateSettingsCommand = new RunMethodWithoutParameterCommand(UpdateSettings, errorHandler.HandleError); RefreshSelectedPlaylistCommand = new RunMethodWithoutParameterCommand(UpdateSelectedPlaylist, errorHandler.HandleError); ShowLogsCommand = new RunMethodWithoutParameterCommand(ShowLogsWindow, errorHandler.HandleError); _searchTypeDelayDeferTimer = new DeferTimer(async() => await SearchForVideos(SearchText), errorHandler.HandleError); _selectedFilterDataFromComboBoxDeferTimer = new DeferTimer(async() => await GetVideosForPlaylist(SelectedFilterFromComboBox), errorHandler.HandleError); _selectedVideoChangedDeferTimer = new DeferTimer(async() => await SelectedVideoChanged(SelectedVideo), errorHandler.HandleError); _updateDataViewModel = updateDataViewModel; _windowService = windowService; _doWorkOnUi = doWorkOnUi; _debugSettings = debugSettings; _logger = logger; _debugSettings.ShowIdsChanged += DebugSettingsOnShowIdsChanged; SpecialVideoFilters = new List <VideoFilter>() { new() { Title = "All", FilterType = FilterType.All }, new() { Title = "Uncategorized", FilterType = FilterType.Uncategorized }, }; }
public WindowExtensions([NotNull] IDoWorkOnUi doWorkOnUi) => _doWorkOnUi = doWorkOnUi;