public void UpdateSchematic() { OverlaySchematic.DataContext = null; // Set to null first to force rebind in case the schematic hasn't changed, but we want to update the UI OverlaySchematic.DataContext = Plugin.SimulationProcessor.Schematic; (LoadCircuitButton.Content as TextBlock).Text = (Plugin.SimulationProcessor.Schematic != null) ? Plugin.SimulationProcessor.SchematicName : "Load Schematic"; schematicWindow = null; for (int i = 0; i < OversampleComboBox.Items.Count; i++) { if (int.Parse((OversampleComboBox.Items[i] as ComboBoxItem).Content as string) == Plugin.SimulationProcessor.Oversample) { OversampleComboBox.SelectedIndex = i; break; } } for (int i = 0; i < IterationsComboBox.Items.Count; i++) { if (int.Parse((IterationsComboBox.Items[i] as ComboBoxItem).Content as string) == Plugin.SimulationProcessor.Iterations) { IterationsComboBox.SelectedIndex = i; break; } } }
private void ShowCircuitButton_Click(object sender, RoutedEventArgs e) { if (Plugin.SimulationProcessor.Schematic != null) { if (schematicWindow == null) { schematicWindow = new SchematicWindow() { DataContext = Plugin.SimulationProcessor.Schematic, Title = Plugin.SimulationProcessor.SchematicName }; } schematicWindow.Show(); schematicWindow.Activate(); } }