I am looking for a way to swap the contents of part of my application to predefined pages. I got to ContentControl , but I cannot copy content from my pages. The code I used was
ContentControl1.Content = new PageName().Content
which gave me an exception stating that the Specified element is already the logical child of another element. Disconnect it first. Specified element is already the logical child of another element. Disconnect it first.
Can I load a page in ContentControl ?
Alternatively, is it possible to use the Visual Studio constructor in some way to create pages and store them in a way that is easier to load into ContentControl ?
And finally, it will make my day, but is there a way that I can contain content inside the ContentControl call methods declared in Window that contain it?
Soumya
source share