public MainWindow(StatusCharacterMap statusCharacterMap, IRepositoryInformationAggregator aggregator, IRepositoryMonitor repositoryMonitor, IRepositoryActionProvider repositoryActionProvider, IRepositoryIgnoreStore repositoryIgnoreStore, IAppSettingsService appSettingsService) { InitializeComponent(); DataContext = new MainWindowPageModel(appSettingsService); SettingsMenu.DataContext = DataContext; // this is out of the visual tree _monitor = repositoryMonitor as DefaultRepositoryMonitor; if (_monitor != null) { _monitor.OnScanStateChanged += OnScanStateChanged; ShowScanningState(_monitor.Scanning); } _repositoryActionProvider = repositoryActionProvider ?? throw new ArgumentNullException(nameof(repositoryActionProvider)); _repositoryIgnoreStore = repositoryIgnoreStore ?? throw new ArgumentNullException(nameof(repositoryIgnoreStore)); lstRepositories.ItemsSource = aggregator.Repositories; var view = CollectionViewSource.GetDefaultView(lstRepositories.ItemsSource); view.CollectionChanged += View_CollectionChanged; view.Filter = FilterRepositories; lstRepositories.Items.SortDescriptions.Add( new SortDescription(nameof(RepositoryView.Name), ListSortDirection.Ascending)); txtHelp.Text = GetHelp(statusCharacterMap); PlaceFormToLowerRight(); }
public MainWindow(StatusCharacterMap statusCharacterMap, IRepositoryInformationAggregator aggregator, IRepositoryMonitor repositoryMonitor, IRepositoryActionProvider repositoryActionProvider, IRepositoryIgnoreStore repositoryIgnoreStore, IAppSettingsService appSettingsService, ITranslationService translationService) { _translationService = translationService; InitializeComponent(); AcrylicWindow.SetAcrylicWindowStyle(this, AcrylicWindowStyle.None); DataContext = new MainWindowPageModel(appSettingsService); SettingsMenu.DataContext = DataContext; // this is out of the visual tree _monitor = repositoryMonitor as DefaultRepositoryMonitor; if (_monitor != null) { _monitor.OnScanStateChanged += OnScanStateChanged; ShowScanningState(_monitor.Scanning); } _repositoryActionProvider = repositoryActionProvider ?? throw new ArgumentNullException(nameof(repositoryActionProvider)); _repositoryIgnoreStore = repositoryIgnoreStore ?? throw new ArgumentNullException(nameof(repositoryIgnoreStore)); lstRepositories.ItemsSource = aggregator.Repositories; var view = CollectionViewSource.GetDefaultView(lstRepositories.ItemsSource); view.CollectionChanged += View_CollectionChanged; view.Filter = FilterRepositories; lstRepositories.Items.SortDescriptions.Add( new SortDescription(nameof(RepositoryView.Name), ListSortDirection.Ascending)); var appName = System.Reflection.Assembly.GetEntryAssembly().GetName(); txtHelpCaption.Text = appName.Name + " " + appName.Version.ToString(2); txtHelp.Text = GetHelp(statusCharacterMap); PlaceFormByTaskbarLocation(); }