The point here is that I want to replicate the following example within XAML-page. Difference here is that I don't know beforehand the quantity of data to show, so it has to be kind of generic one.
Let's say, I have some model UserModel.cs
which looks like this:
class UserModel
{
string FirstName { get; set; }
int BirthYear { get; set; }
}
and I have some view DataViewer.cs
which looks like this:
class DataViewer
{
static void ShowData()
{
var users = new List<UserModel>()
{
new UserModel() { FirstName = "Thomas", BirthYear = 1995 },
new UserModel() { FirstName = "Arthur", BirthYear = 1991 },
new UserModel() { FirstName = "John", BirthYear = 2000 }
};
foreach (var user in users)
{
Console.WriteLine($"{user.FirstName} was born in {user.BirthYear}");
}
}
}