I have no idea why this is so hard for me to find an answer to. Essentially, just like in a windows form, i create a new object of a page, and then display it.
However you cant do that in WPF, so instead, I set the content of the main page, to that of the created object.
This all works great, but when i want to shut the newly opened page, I cannot. I obviously cant do anything like this.close. And I have no reference to the MainWindow, so I cannot re-set the content?
Please help, I am VERY confused!
More Details...
Sorry, Its not the most clear question. In my mainWindow, I have
Page1 mainMenu = new Page1();
this.Content = mainMenu;
This brings up my new page, like a new window, but without actually loading a new window, which is actually great!
However, my current page now has the content of Page1. So its running the code and displaying the content from Page1.
In page one, how do I return the content back to MainWindow? I have tried many things which all essentially get the error -
"Logical tree depth exceeded while traversing the tree. This could indicate a cycle in the tree."