public void AddAnswer(AnswerInfo answer = null) { CtrlErrorAnswers.Visibility = Visibility.Collapsed; AnswerMinEditControl amec = new AnswerMinEditControl(CtrlIsRadio.IsChecked == true, answer); amec.MouseLeftButtonUp += CtrlAnswerCard_Click; CtrlAnswers.Children.Add(amec); }
public QuestionEditControl(QuestionInfo question = null) { InitializeComponent(); manager = AppManager.Instance; Question = question; selectedCard = null; }
private void CtrlAnswerCard_Click(object sender, RoutedEventArgs e) { if (selectedCard != null) { selectedCard.IsSelected = false; selectedCard.Text = CtrlEditAnswer.CtrlText.Text; } selectedCard = sender as AnswerMinEditControl; selectedCard.IsSelected = true; CtrlEditAnswer.AnswerMinEditControl = selectedCard; }
public void RemoveAnswer(AnswerMinEditControl amec) { if (amec == selectedCard) { selectedCard = null; CtrlEditAnswer.AnswerMinEditControl = null; } CtrlAnswers.Children.Remove(amec); if (CtrlAnswers.Children.Count == 0) { CtrlErrorAnswers.Visibility = Visibility.Visible; } }
public AnswerEditControl() { InitializeComponent(); AnswerMinEditControl = null; manager = AppManager.Instance; }