private void btnOpenFile_ClickClear(object sender, RoutedEventArgs e) { MainPlot.plt.Clear(); MainPlot.Render(); //Resets our datagrid size since the user may want to look at the graph DGrid.Margin = new System.Windows.Thickness(0, 369, 0, 0); DGrid.DataContext = null; PopOut.IsEnabled = false; dgrab = null; }
private void YOffsetBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) { Double.TryParse(YOffsetBox.Text, out yOffset); if (dgrab != null) { MainPlot.plt.Clear(); createScatterPlot(); MainPlot.Render(); } }
private void btnOpenFile_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == true) { btnOpenFile_ClickClear(sender, e); dgrab = new DataGrabber(openFileDialog.FileName); PopOut.IsEnabled = true; //Resets our datagrid size since the user may want to look at the graph DGrid.Margin = new System.Windows.Thickness(0, 369, 0, 0); createScatterPlot(); MainPlot.Render(); dtb = dgrab.df.ToDataTable(); DGrid.DataContext = dtb; } }
private void plotMouseDoubleClick(object sender, MouseEventArgs e) { (double mouseX, double mouseY) = MainPlot.GetMouseCoordinates(); sph.HighlightClear(); var(trackerX, trackerY, index) = sph.HighlightPointNearest(mouseX, mouseY); for (int i = 0; i < dtb.Rows.Count; i++) { DataTable curTable = (DataTable)DGrid.DataContext; DataRow curRow = curTable.Rows[i]; string cellContent = String.Join(", ", curRow.ItemArray); if (cellContent.Contains(trackerX.ToString()) && cellContent.Contains(trackerY.ToString())) { DGrid.ScrollIntoView(DGrid.Items[i]); DGrid.SelectedIndex = i; DGrid.UpdateLayout(); } } MainPlot.Render(); }