public LoginPage() { InitializeComponent(); controlsVM = (Application.Current as App).ControlsVM; dashBoardVM = (Application.Current as App).DashVM; mapVM = (Application.Current as App).MapVM; errorVm = (Application.Current as App).ErrorVm; }
public ControlsPage(MapVM map, ControlsVM controls, DashBoardVM dashBoard, ErrorVm error) { errorVm = error; mapVM = map; controlsVM = controls; dashBoardVM = dashBoard; InitializeComponent(); Map.DataContext = mapVM; DashBoard.DataContext = dashBoardVM; Controls.DataContext = controlsVM; Error.DataContext = errorVm; }
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(MapVM mapVM) { mapViewModel = mapVM; DataContext = mapViewModel; }