Пример #1
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     ConnSettingsViewModel = new ConnSettingsViewModel();
     ControlRoomViewModel  = new ControlRoomViewModel();
     DataViewViewModel     = new DataViewViewModel();
     JoystickViewModel     = new JoystickViewModel();
     MapViewModel          = new MapViewModel();
     SlidersViewModel      = new SlidersViewModel();
 }
 private void initializeViewModels(IFlightSimulatorModel model)
 {
     this.joystickVm          = new JoystickViewModel();
     this.dashboardVm         = new DashboardViewModel();
     this.mapVm               = new MapViewModel();
     this.connectionControlVm = new ConnectionControlViewModel();
     this.joystickVm.SetModel(model);
     this.mapVm.SetModel(model);
     this.dashboardVm.SetModel(model);
     this.connectionControlVm.SetModel(model);
     this.BingMap.DataContext         = this.mapVm;
     this.Joystick.DataContext        = this.joystickVm;
     this.ControlsDisplay.DataContext = this.dashboardVm;
 }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();
            flightSimulatorModel = new MyFlightSimulatorModel(new MyTelnetClient());

            dataDisplayViewModel             = new DataDisplayViewModel(flightSimulatorModel);
            dataDisplayControl.DataDisplayVM = dataDisplayViewModel;

            graphViewModel       = new GraphViewModel(flightSimulatorModel);
            graphControl.GraphVM = graphViewModel;

            joystickViewModel          = new JoystickViewModel(flightSimulatorModel);
            joystickControl.JoystickVM = joystickViewModel;

            mediaViewModel            = new MediaViewModel(flightSimulatorModel);
            mediaPanelControl.MediaVM = mediaViewModel;

            startMenuViewModel           = new StartMenuViewModel(flightSimulatorModel);
            startMenuControl.StartMenuVM = startMenuViewModel;
        }
        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();
        }