private void OnRowDoubleClick(object sender, MouseButtonEventArgs e) { var recordId = helicopterViewModel.SelectedRecord.Id; using (var context = new HelicopterModelEntities()) { var sessionRecord = DatabaseManager.GetSessionRecord(recordId, context); sessionPidChartWindow = new SessionPidChartWindow(sessionRecord); sessionPidChartWindow.Show(); Log.DebugFormat("Loaded an old session with ID: {0}", recordId); } }
private void OnViewModelPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "IsConnected" || e.PropertyName == "IsDatabaseConnected") { UpdateStatusBar(); } else if (e.PropertyName == "IsSessionRunning") { if (helicopterViewModel.IsPidSessionRunning) { StartPidCharting(); } else { StopPidCharting(); } } else if (e.PropertyName == "IsSessionComplete") { if (helicopterViewModel.HelicopterManager.IsSessionComplete) { var sessionRecord = DatabaseManager.CreateNewSessionRecord(helicopterViewModel.HelicopterManager.Session, helicopterViewModel.HelicopterManager.HelicopterSettings); sessionPidChartWindow = new SessionPidChartWindow(sessionRecord); sessionPidChartWindow.Show(); } } }