Beispiel #1
0
 // Constructor.
 public ViewModel(IAirplaneModel airplaneModel)
 {
     this.model              = airplaneModel;
     this.ControlsViewModel  = new ControlsViewModel(this.model);
     this.DashboardViewModel = new DashboardViewModel(this.model);
     this.MapViewModel       = new MapViewModel(this.model);
     this.SettingsViewModel  = new SettingsViewModel(model);
 }
 // Constructor.
 public ControlsViewModel(IAirplaneModel airplaneModel)
 {
     this.model             = airplaneModel;
     model.PropertyChanged +=
         delegate(Object sender, PropertyChangedEventArgs e) {
         NotifyPropertyChanged("VM_" + e.PropertyName);
     };
 }
Beispiel #3
0
 void App_Startup(object sender, StartupEventArgs e)
 {
     // Initialize all view models and model in high level class-App.
     airplaneModel = new MyAirplaneModel();
     settingsVM    = new SettingsViewModel(airplaneModel);
     dashboardVM   = new DashboardViewModel(airplaneModel);
     mapVM         = new MapViewModel(airplaneModel);
     controlsVM    = new ControlsViewModel(airplaneModel);
 }