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(WheelVM wheelVM) { wheelViewModel = wheelVM; DataContext = wheelViewModel; }