My binding is showing me the values perfectly. But I just want to be sure that I learn the technology in its right direction. I want to follow MVVM pattern.
Here is my code for viewModel:
class MainPageViewModel
{
public MainPageViewModel()
{
using (Lab_Lite_Entities db = new Lab_Lite_Entities())
{
Sex = (from t in db.TypeSexes
select t.Value).ToList();
}
}
public List<string> Sex
{
get;
private set;
}
}
Here are my tables:
Persons table:
ID
Name
SexID
Age
Sex table:
SexID
Value