private void GraphEditCircuit() { if (CircuitsTreeView.SelectedItem == null) { return; } if (CircuitsTreeView.SelectedItem.GetType() == typeof(Circuit)) { var circuit = (Circuit)CircuitsTreeView.SelectedItem; var addCircuitWindow = new GraphicalConfigCircuit(circuit.Info) { Owner = this }; if (addCircuitWindow.ShowDialog() != true) { return; } circuit.FlushCircuitStyle(_zoomScale); CircuitsTreeView.ItemsSource = null; CircuitsTreeView.ItemsSource = _circuits; } else if (CircuitsTreeView.SelectedItem.GetType() == typeof(Dot)) { var dot = (Dot)CircuitsTreeView.SelectedItem; var editDotWindow = new GraphicalConfigDot(dot) { Owner = this }; editDotWindow.ShowDialog(); } }
private void Mask_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount >= 2) { var editDot = new GraphicalConfigDot(this); editDot.ShowDialog(); } else { ParentCanvas.MouseMove += Canvas_MouseMove; DotCanvas.MouseMove += Canvas_MouseMove; ParentCanvas.MouseLeftButtonUp += Canvas_MouseLeftButtonUp; DotCanvas.MouseLeftButtonUp += Canvas_MouseLeftButtonUp; } }