private void UserControl_Loaded(object sender, RoutedEventArgs e) { DataOperationNode dataOperationNode = dgSamples.DataContext as DataOperationNode; if (dataOperationNode != null) { dataOperationNode.InitializingSampleEntries(); dgSamples.ItemsSource = dataOperationNode.SampleEntries; } }
private void DgSamples_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e) { SampleEntry sampleEntry = dgSamples.SelectedItem as SampleEntry; if (_lastSampleEntry == sampleEntry) { return; } if (sampleEntry == null) { return; } _lastSampleEntry = sampleEntry; DataOperationNode dataOperationNode = DataContext as DataOperationNode; if (dataOperationNode == null) { return; } if (dataOperationNode.DataOperation == null) { return; } string sampleName = sampleEntry.SampleName; List <SampleCurve> sampleCurves = dataOperationNode.DataOperation.GetSampleCurves(sampleName); if (sampleCurves == null) { return; } if (sampleCurves.Count == 0) { return; } ShowSampleCurve(sampleCurves[0]); }