I'm building a questionnaire application that shows a series of questions to the user.
To simplify the model, the question is represented by
class Question{
String name;
bool ComboBox;
String[] choices;
}
In the code-behind I have a ObservableCollection that is used by the DataContext.
The XAML looks like this
...
<ItemsControl ItemsSource="{Binding}" ItemTemplateSelector="{...}">
</ItemsControl>
The ItemTemplateSelector choose the ItemTemplate based on the Property ComboBox specified in Question object. One ItemTemplate shows the String[] choices inside a ComboBox, the other create as many TextBox as the number of Strings in the array.
What's the best way to gather all the data inserted by the user.