I've created some windows dynamically, and named them dynamically, using data from an SQL database. Now I want to reference them using data from a label that has been clicked on. Below is a basic example.
private void buildWindow(string contentFromDataBase)
{
Window fooWindow = new Window();
fooWindow.Name = contentFromDataBase + "Window"
}
//Event handler for a label being clicked
private void showWindow(object sender, EventArgs e)
{
//Now I want to get access to fooWindow via it's name, which is similar to the label name
Label foo = sender as Label;
foo.Name + "Window".show();
}
How do I do this?