I guessed that adding the missing code would look following code.
class MainPageViewModel
{
public MainPageViewModel() => Items = new ObservableCollection<Person>
{
new Person(1,"John Smith","300 W. Main","India"),
new Person(2,"Ron Stevenson","N. Broadway","Washington"),
new Person(3,"Sally Smith","6700 W. Covington","Casablanca"),
new Person(4,"Ken Jenkins","500 E. Washington","NYC")
};
public ObservableCollection<Person> Items { get; }
}
If this is correct, the conversion can be done as follow.
class MainPageViewModel
{
public MainPageViewModel()
{
this.Items = new ObservableCollection<Person>
{
new Person(1,"John Smith","300 W. Main","India"),
new Person(2,"Ron Stevenson","N. Broadway","Washington"),
new Person(3,"Sally Smith","6700 W. Covington","Casablanca"),
new Person(4,"Ken Jenkins","500 E. Washington","NYC")
};
}
public ObservableCollection<Person> Items { get; }
}
This is the constructor that initializes the Items property.
To sum up, your presented code is Expression-bodied constructor.