private void BatteryView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { BatteryViewControl control = sender as BatteryViewControl; if (control == null) { throw new Exception(); } int index = BatteryViews.IndexOf(control); if (index < 0) { throw new Exception(); } double current = double.Parse(CurrentTxtBox.Text); BatteryWriteData.SetCellCurrent(index, current); }