public DebuggerWindow(StationController stationController) { InitializeComponent(); Dispatcher.Invoke(() => IsEnabled = false); //disable until connected _stationController = stationController; _logViewModel = new ViewModels.LogViewModel(); logView.DataContext = _logViewModel; _sendCommandViewModel = new ViewModels.SendCommandViewModel(); sendCommandView.DataContext = _sendCommandViewModel; _scenarioSelectViewModel = new ViewModels.ScenarioSelectViewModel(); _scenarioSelectViewModel.ScenarioCalled += ScenarioViewModel_ScenarioCalled; scenarioSelectView.DataContext = _scenarioSelectViewModel; _sendCommandViewModel.ExecuteExpressionCommand = new Commands.RelayCommand(command => { _stationController.SendCommand((string)command); _sendCommandViewModel.CommandExpression = string.Empty; }, _ => !string.IsNullOrEmpty(_sendCommandViewModel.CommandExpression)); _stationController.ClientConnected += StationController_ClientConnected; _stationController.ClientDisconnected += StationController_ClientDisconnected; _stationController.DataReceived += StationController_DataReceived; _stationController.RunningStateChanged += StationController_RunningStateChanged; _scenarioSelectViewModel.Scenarios = new System.Collections.ObjectModel.ObservableCollection <Scenario>(_stationController.Scenarios); }
public Log() { InitializeComponent(); ViewModels.LogViewModel logViewModel = new ViewModels.LogViewModel(); this.logDataGrid.ItemsSource = logViewModel.LogsTable; this.DataContext = logViewModel; }
public Log() { InitializeComponent(); ViewModels.LogViewModel logViewModel = new ViewModels.LogViewModel(); this.logDataGrid.ItemsSource = logViewModel.LogsTable; this.DataContext = logViewModel; logViewModel.logModel.Logs.Add(new DataStructures.LogLine(MessageTypeEnum.WARNING, "hello")); logViewModel.logModel.Logs.Add(new DataStructures.LogLine(MessageTypeEnum.FAIL, "hi")); }