How to dynamically create page objects from a collection of page names (strings)?
In my ViewModel, I want to build a collection of page objects from this list of page names:
private string[] pageNames = {
"Introduction.xaml",
"Slide1.xaml",
"Slide2.xaml"
};
How to create them dynamically eg. something like that:
foreach (string pageName in pageNames)
{
//PSEUDO CODE:
Page thePage = new &&pageName();
thePages.Add(thePage);
}
0
a source to share