//只能单选 void event_AnswerSelected(object sender, AnswerSelectedEventArgs e) { foreach (SurveyAnswer_sat sa in spAnswerList.Children) { if (sa.txbAnswerContent.Text.ToString() == e.DICTIONARYNAME && e.DICTIONARYNAME!="") { subAnswer = e.DICTIONARYVALUE; sa.ckbSelect.IsChecked = true; } else sa.ckbSelect.IsChecked = false; } }
//只能单选 void event_AnswerSelected(object sender, AnswerSelectedEventArgs e) { foreach (SurveyAnswer_sat sa in spAnswerList.Children) { if (sa.txbAnswerContent.Text.ToString() == e.DICTIONARYNAME && e.DICTIONARYNAME != "") { subAnswer = e.DICTIONARYVALUE; sa.ckbSelect.IsChecked = true; } else { sa.ckbSelect.IsChecked = false; } } }
private void ckbSelect_Checked(object sender, RoutedEventArgs e) { bool b = (bool)((RadioButton)sender).IsChecked; if (b)//<--可能无用 { if (event_AnswerSelected != null) { AnswerSelectedEventArgs ev = new AnswerSelectedEventArgs(); ev.DICTIONARYVALUE = answerInfo.DICTIONARYVALUE.ToString(); ev.DICTIONARYNAME = this.txbAnswerContent.Text; event_AnswerSelected(this, ev); } } }
private void ckbSelect_Checked(object sender, RoutedEventArgs e) { bool b = (bool)((RadioButton)sender).IsChecked; if (b)//<--可能无用 if (event_AnswerSelected != null) { AnswerSelectedEventArgs ev = new AnswerSelectedEventArgs(); ev.DICTIONARYVALUE = answerInfo.DICTIONARYVALUE.ToString(); ev.DICTIONARYNAME = this.txbAnswerContent.Text; event_AnswerSelected(this, ev); } }