public MainWindow() { InitializeComponent(); NetworkConnection generalTelnet = new NetworkConnection(); MainWindowViewModel myViewModel = new MainWindowViewModel(new MainWindowModel(generalTelnet)); this.DataContext = myViewModel; FlightBoardViewModel flightBoardViewModel = new FlightBoardViewModel(new FlightBoardModel(generalTelnet)); this.flightBoardView.SetVM(flightBoardViewModel); this.flightBoardView.DataContext = flightBoardViewModel; CommandCenterUCVM ccucvm = new CommandCenterUCVM(new CommandCenterUCModel(generalTelnet)); this.commandCenterUCView.SetVM(ccucvm); }
public void SetVM(CommandCenterUCVM viewModel) { this.DataContext = viewModel; myViewModel = viewModel; }
/// <summary> /// Sets a view model for this view /// </summary> /// <param name="viewModel">the required view model</param> public void SetVM(CommandCenterUCVM viewModel) { this.DataContext = viewModel; this.JoystickView.SetVM(viewModel); }