Exemplo n.º 1
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"));
        }
Exemplo n.º 2
0
 // Set the view model and data context.
 public void SetViewModel(WheelVM wheelVM)
 {
     wheelViewModel = wheelVM;
     DataContext    = wheelViewModel;
 }