//TODO DarthAffe 06.01.2016: This is a somehow weird design ... protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); this.DispatcherUnhandledException += OnDispatcherUnhandledException; _apiService = new HikariApiService(); _configService = new ConfigService(); _patchService = new PatchService(_apiService, UpdateStatusFunc); _topBarViewModel = new TopBarViewModel(_configService); _gamesViewModel = new GamesViewModel(_configService, _patchService); _mainWindowViewModel = new MainWindowViewModel(_apiService, _topBarViewModel, _gamesViewModel); new MainWindow { DataContext = _mainWindowViewModel }.Show(); }
public MainWindowViewModel(HikariApiService apiService, TopBarViewModel topBarViewModel, GamesViewModel gamesViewModel) { this._apiService = apiService; this.TopBarViewModel = topBarViewModel; this.GamesViewModel = gamesViewModel; }