I am creating a questionnaire application in WPF. The GUI displaying the questionnaire to the user is built dynamically at runtime through code depending on an XML questionnaire definition. The questions in the questionnaire can be multiple choice questions, yes/no quesitons and free text questions. I create text blocks representing question bodies and then depending on whether the question is multiple choice (I create a set of radio buttons to represent the choices) or yes no (two radio buttons - one for yes and other for no) or free text (text box for collecting user input). My problem is when the user clicks a submit button, I need to collect the answers from the controls and store them back to my object. How do I do this?