Ejemplo n.º 1
0
 public LoginPage()
 {
     InitializeComponent();
     controlsVM  = (Application.Current as App).ControlsVM;
     dashBoardVM = (Application.Current as App).DashVM;
     mapVM       = (Application.Current as App).MapVM;
     errorVm     = (Application.Current as App).ErrorVm;
 }
Ejemplo n.º 2
0
 public ControlsPage(MapVM map, ControlsVM controls, DashBoardVM dashBoard, ErrorVm error)
 {
     errorVm     = error;
     mapVM       = map;
     controlsVM  = controls;
     dashBoardVM = dashBoard;
     InitializeComponent();
     Map.DataContext       = mapVM;
     DashBoard.DataContext = dashBoardVM;
     Controls.DataContext  = controlsVM;
     Error.DataContext     = errorVm;
 }
Ejemplo n.º 3
0
        public MainVM(IFlightSimulatorModel m)
        {
            model = m;
            model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
            {
                NotifyPropertyChanged("VM" + e.PropertyName);
            };
            // Initialize other view models
            WheelViewModel     = new WheelVM(model);
            DashboardViewModel = new DashboardVM(model);
            MapViewModel       = new MapVM(model);

            Ip   = ConfigurationManager.AppSettings.Get("ip");
            Port = int.Parse(ConfigurationManager.AppSettings.Get("port"));
        }
 // Set the view model and data context.
 public void SetViewModel(MapVM mapVM)
 {
     mapViewModel = mapVM;
     DataContext  = mapViewModel;
 }