Пример #1
0
 public FlightBoardViewModel(IFlightSimulatorModel model)
 {
     this.m_model = model;
     //notify when the model is notifying a change.
     m_model.PropertyChanged += delegate(object s, PropertyChangedEventArgs e)
     { NotifyPropertyChanged(e.PropertyName); };
 }
 /// <summary>
 /// Sets the model.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual void SetModel(IFlightSimulatorModel model)
 {
     this.model             = model;
     model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) {
         this.NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
Пример #3
0
 public DashBoardViewModel(IFlightSimulatorModel model)
 {
     this._model = model;
     this._model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs property)
     {
         PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property.PropertyName));
     };
 }
Пример #4
0
 public MapVM(IFlightSimulatorModel m)
 {
     model = m;
     model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM" + e.PropertyName);
     };
 }
 public GearControlViewModel(IFlightSimulatorModel m)
 {
     this.model             = m;
     model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
Пример #6
0
        // CTOR
        public JoystickVM(IFlightSimulatorModel model)
        {
            this.model = model;

            model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
            {
                NotifyPropertyChanged("VM_" + e.PropertyName);
            };
        }
Пример #7
0
 public JoystickViewModel(IFlightSimulatorModel model)
 {
     this._model = model;
     this._model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs property)
     {
         PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property.PropertyName));
     };
     //_model.Rudder = -15;
 }
Пример #8
0
 public StartMenuViewModel(IFlightSimulatorModel model)
 {
     this.model = model;
     this.model.PropertyChanged +=
         delegate(Object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
 public FlightSimulatorViewModel(IFlightSimulatorModel m)
 {
     this.model             = m;
     model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); };
     // create the viewModels that will contact the model
     DashboardVM   = new DashboardViewModel(this.model);
     MediaPlayerVM = new MediaPlayerViewModel(this.model);
     GearControlVM = new GearControlViewModel(this.model);
     GraphsVM      = new GraphsViewModel(this.model);
     DetectorVM    = new DetectorViewModel(this.model);
 }
 /// <summary>Initializes a new instance of the <see cref="T:System.Object"/> class.</summary>
 /// <param name="model"></param>
 public FlightGearViewModel(IFlightSimulatorModel model)
 {
     this.model             = model;
     model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) {
         this.NotifyPropertyChanged("VM_" + e.PropertyName);
         if (e.PropertyName == "Latitude" || e.PropertyName == "Longitude")
         {
             this.VM_Location = new Location(VM_Latitude, VM_Longitude);
             this.NotifyPropertyChanged("VM_Location");
         }
     };
 }
Пример #11
0
 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;
 }
Пример #12
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"));
        }
Пример #13
0
        public GraphsViewModel(IFlightSimulatorModel m)

        {
            this.model             = m;
            model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
            {
                if (String.Compare(e.PropertyName, "Attributes") == 0)
                {
                    //
                }
                OnPropertyChanged("VM_" + e.PropertyName);
            };

            PlotModel = new PlotModel();
            SetUpModel();
            PlotModelCorr = new PlotModel();
            SetUpModelCorr();
        }
Пример #14
0
        //public MediaPlayerViewModel(IMediaPlayerModel model)
        public MediaPlayerViewModel(IFlightSimulatorModel model)
        {
            this.model             = model;
            model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
            {
                if (string.Compare(e.PropertyName, "Timer") == 0)
                {
                    // VM_Timer = model.Timer;
                    NotifyPropertyChanged("VM_Timer");
                    return;
                }
                if (string.Compare(e.PropertyName, "PlayingSpeed") == 0)
                {
                    //VM_PlayingSpeed = model.PlayingSpeed;
                    NotifyPropertyChanged("VM_PlayingSpeed");
                    return;
                }
                if (string.Compare(e.PropertyName, "FinishTime") == 0)
                {
                    //M_FinishTime = model.FinishTime;
                    NotifyPropertyChanged("VM_FinishTime");
                    return;
                }

                /*if (string.Compare(e.PropertyName, "LineNumber") == 0)
                 * {
                 *  VM_LineNumber = model.LineNumber;
                 *  //VM_Timer = 0.1 * (double)VM_LineNumber;
                 *  // NotifyPropertyChanged("VM_Timer");
                 *
                 *  VM_Timer = TimeSpan.FromSeconds(0.1 * VM_LineNumber).ToString(@"hh\:mm\:ss");;
                 *  NotifyPropertyChanged("VM_LineNumber");
                 *  return;
                 * }
                 * if (string.Compare(e.PropertyName, "MaxLine") == 0)
                 * {
                 *  //VM_MaxLine = model.MaxLine;
                 *  VM_FinishTime = 0.1 * (double)VM_MaxLine;
                 *  //NotifyPropertyChanged("VM_MaxLine");
                 * NotifyPropertyChanged("VM_FinishTime");
                 *  return;
                 * };*/
            };
        }
Пример #15
0
 // Constructor
 public DashboardViewModel(IFlightSimulatorModel m)
 {
     this.model             = m;
     model.PropertyChanged += DashboardPropertyChange;
 }
Пример #16
0
 /// <summary>
 /// Handles the OnStartup event of the App control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="StartupEventArgs"/> instance containing the event data.</param>
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     this.SimulatorModel   = new FlightSimulatorModel(new FlightGearTCPHandler());
     this.DummyServerModel = new FlightSimulatorModel(new DummyServerTCPHandler());
 }
Пример #17
0
        private void initializeDummyServerViewModels()
        {
            IFlightSimulatorModel model = (Application.Current as App)?.DummyServerModel;

            this.initializeViewModels(model);
        }
Пример #18
0
 public AutopilotControlViewModel(IFlightSimulatorModel model)
 {
     this.model = model;
 }
Пример #19
0
 public FlightSimulatorDashboardVM(IFlightSimulatorModel model)
 {
     _model = model;
     _model.PropertyChanged +=
         delegate(object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); };
 }
 /// <summary>Initializes a new instance of the <see cref="AFlightGearViewModel" /> class.</summary>
 /// <param name="model">The model.</param>
 public AFlightGearViewModel(IFlightSimulatorModel model)
 {
     this.model = model;
 }
Пример #21
0
 // CTOR
 public ConnectionViewModel(IFlightSimulatorModel model)
 {
     this.model = model;
 }
Пример #22
0
 public DetectorViewModel(IFlightSimulatorModel m)
 {
     this.model             = m;
     model.PropertyChanged += DetectorPropertyChange;
 }
Пример #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapViewModel"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public MapViewModel(IFlightSimulatorModel model)
     : base(model)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DashboardViewModel"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public DashboardViewModel(IFlightSimulatorModel model)
     : base(model)
 {
 }
 public FlightSimulatorControlVM(IFlightSimulatorModel model)
 {
     _model = model;
     // _model.PropertyChanged +=
     //     delegate (object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); };
 }
Пример #26
0
        public Data(IFlightSimulatorModel m)

        {
            this.model = m;
        }
Пример #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JoystickViewModel"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public JoystickViewModel(IFlightSimulatorModel model)
     : base(model)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConnectionControlViewModel"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public ConnectionControlViewModel(IFlightSimulatorModel model)
     : base(model)
 {
 }
Пример #29
0
        private void initializeFlightGearViewModels()
        {
            IFlightSimulatorModel model = (Application.Current as App)?.SimulatorModel;

            this.initializeViewModels(model);
        }
Пример #30
0
 public ManualControlViewModel(IFlightSimulatorModel model)
 {
     this.model       = model;
     PropertyChanged += model.NotifyPropertySet;
 }