示例#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"));
        }
示例#2
0
 public void SetViewModel(DashboardVM dashboardVM)
 {
     dashboardViewModel = dashboardVM;
     DataContext        = dashboardViewModel;
 }