private void Image_MouseEnter(object sender, MouseEventArgs e) { //isOnImage = true; sgc.UpdateText("OnControl"); Image draggableControl = sender as Image; hgc.Highlight_cell(draggableControl); SpecificElement se = null; foreach (SpecificElement se2 in lc.ec.GetAllElements()) { if (se2.GetName() == draggableControl.Tag.ToString()) { se = se2; break; } } if (!wgc.turn && se != null) { mgc.ShowStatusBox(draggableControl, se.voltage); } hgc.RemoveCheckCircuitBox(); }
private void ContextProperties_Click(object sender, RoutedEventArgs e) { MenuItem item = sender as MenuItem; ContextMenu cm = item.Parent as ContextMenu; Image img = cm.PlacementTarget as Image; SpecificElement se = null; foreach (SpecificElement se2 in lc.ec.GetAllElements()) { if (se2.GetName() == img.Tag.ToString()) { se = se2; break; } } if (se != null) { Element_features ef = new Element_features(se); ef.Show(); } }