// Initializing the simulator models and all of the view models. private void Application_Startup(object sender, StartupEventArgs e) { // Connection part MyTelnetClient TCinstance = MyTelnetClient.Instance; connectVM = new ConnectionViewModel(TCinstance); // Map part IMapModel mapModel = new MyMapModel(TCinstance); mapVM = new MapViewModel(mapModel); // Gear part IGearModel gearModel = new MyGearModel(TCinstance); gearVM = new GearViewModel(gearModel); // Dashboard part IDashboardModel dashboardModel = new MyDashboardModel(TCinstance); dashboardVM = new DashboardViewModel(dashboardModel); }
public MainWindow() { InitializeComponent(); client = new MyTelnetClient(); model = new MainModel(client); vm = new ViewModel(model); mapVm = new MapViewModel(model); // joystickVm = new JoystickViewModel(model); DataContext = vm; dashboardVM = new DashboardViewModel(model); myMapObject.DataContext = mapVm; joystickObject.DataContext = joystickVm; dashboadObject.DataContext = dashboardVM; //vm.model.connect("127.0.0.1", 5402); //vm.model.start(); }
public MainWindow(SimulatorViewModel SimulatorVm, SteersViewModel SteersVm, MapViewModel MapVm, DashboardViewModel DashboardVm) { InitializeComponent(); this.Dispatcher.UnhandledException += HandleAllExceptions; this.vm = SimulatorVm; DataContext = vm; Steers.DataContext = SteersVm; Dashboard.DataContext = DashboardVm; Map.DataContext = MapVm; }