protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); this.am = new AppModel(this.ms); AppViewModel = new AppViewModel(am); ControllersViewModel = new ControllersViewModel(am); DashboardViewModel = new DashboardViewModel(am); MapViewModel = new MapViewModel(am); SettingsViewModel = new SettingsViewModel(am); MainWindow wnd = new MainWindow(); wnd.Show(); }
//Constructor that intizalizing all the view models with the given model. public MainViewModel(IFlightGearModel flightGearModel) { this.dashVM = new DashBoardViewModel(flightGearModel); this.mapVM = new MapViewModel(flightGearModel); this.controllerVM = new ControllersViewModel(flightGearModel); }