public override void Visit(OpenQuestion element) { _result = new FormPanel(); _result.Children.Add(new Label { Content = element.Title }); _result.Children.Add(new TextBox { TextWrapping = TextWrapping.Wrap, AcceptsReturn = true }); AddChildren(element); }
public override void Visit(ChoiceQuestion element) { _result = new FormPanel(); _result.Children.Add(new Label { Content = element.Title }); foreach (var choice in element.Choices) { _result.Children.Add(new CheckBox { Content = choice }); } AddChildren(element); }
public override void Visit(BinaryQuestion element) { _result = new FormPanel(); _result.Children.Add(new Label { Content = element.Title }); _result.Children.Add(new RadioButton { GroupName = element.Title, Content = "Oui", IsChecked = false }); _result.Children.Add(new RadioButton { GroupName = element.Title, Content = "Non", IsChecked = false }); if (!(element as BinaryQuestion).IsRequired) { _result.Children.Add(new RadioButton { GroupName = element.Title, Content = "Ne se prononce pas", IsChecked = false }); } AddChildren(element); }
private void AddChildren(FormElement element) { if (element.Children.Count > 0) { var expander = new Expander(); var panel = new FormPanel(); foreach (var child in element.Children) { var visitor = new FormElementVisitorImpl(); visitor.VisitFormElement(child); visitor.Result.Margin = new Thickness(20, 0, 0, 0); panel.Children.Add(visitor.Result); } expander.Content = panel; _result.Children.Add(expander); } }
public override void Visit(Container element) { _result = new FormPanel(); _result.Children.Add(new Label { Content = element.Title }); AddChildren(element); }