/// <summary>Raises the <see cref="E:System.Windows.Application.Startup" /> event.</summary> /// <param name="e">A <see cref="T:System.Windows.StartupEventArgs" /> that contains the event data.</param> protected override void OnStartup(StartupEventArgs e) { var version = typeof(App).Assembly.GetName().Version; Log.Info($"Managing app started. Program version: {version}."); AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; base.OnStartup(e); var prioritySearcher = new PriorityVectorSearcher(); var context = new DssContext(); var dataProvider = new DataBaseProvider(context); var viewModelList = new List <IPageViewModel> { new TaskManagingViewModel(dataProvider), new InputViewModel(dataProvider), new PairMatrixViewModel(dataProvider), new ResultViewModel(dataProvider, prioritySearcher) }; var mainWindowViewModel = new MainWindowViewModel(viewModelList, dataProvider); var mainWindow = new MainWindow { DataContext = mainWindowViewModel }; Log.Info("Initialize is successful"); mainWindow.Show(); }
public DataBaseProvider(DssContext context) { _context = context; CurrentTask = Tasks.FirstOrDefault(); RefreshData(); }