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); }; }
public DashBoardViewModel(IFlightSimulatorModel model) { this._model = model; this._model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs property) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property.PropertyName)); }; }
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); }; }
// CTOR public JoystickVM(IFlightSimulatorModel model) { this.model = model; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
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; }
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"); } }; }
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; }
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")); }
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(); }
//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; * };*/ }; }
// Constructor public DashboardViewModel(IFlightSimulatorModel m) { this.model = m; model.PropertyChanged += DashboardPropertyChange; }
/// <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()); }
private void initializeDummyServerViewModels() { IFlightSimulatorModel model = (Application.Current as App)?.DummyServerModel; this.initializeViewModels(model); }
public AutopilotControlViewModel(IFlightSimulatorModel model) { this.model = model; }
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; }
// CTOR public ConnectionViewModel(IFlightSimulatorModel model) { this.model = model; }
public DetectorViewModel(IFlightSimulatorModel m) { this.model = m; model.PropertyChanged += DetectorPropertyChange; }
/// <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); }; }
public Data(IFlightSimulatorModel m) { this.model = m; }
/// <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) { }
private void initializeFlightGearViewModels() { IFlightSimulatorModel model = (Application.Current as App)?.SimulatorModel; this.initializeViewModels(model); }
public ManualControlViewModel(IFlightSimulatorModel model) { this.model = model; PropertyChanged += model.NotifyPropertySet; }