# Visual Basic > Xamarin >  Generate dynamic control in xaml

## FunkySloth

Hi Guys,

Does anyone have sample on how to generate a dynamic control base on return type from database. I was able to get the data, however i have no idea how to generate the dynamic controls in xaml, this is a survey type application.

I got this kind of Models:



```
Public class Question
{
     public int Id { get; set; }
     public string description { get; set; }
     public List<Answer> Answers { get; set; }
}

public class Answer
{
    public int Id { get; set; }
    public int questionId { get; set; }
    public string description { get; set; }
    public string controlType { get; set; }
}
```

The output could be:

Question Description
 - RadioButton
 - RadioButton

Question Description
 - Textbox

Question Description
 - Dropdown

I am new on how the structure of xamarin works.

Thank you

----------


## mmx88_ValidUser

Uh...no but it needs to be protected to be thread safe.

----------

