Frage

I'm reading about the WPF Navigation Services and I have a general question.

At run-time I want to be able to parse an external XML file that has information about an UI (i.e. a series of screens) and then in the code-behind create a WPF Navigation service with multiple Pages. Is it possible to create a new WPF Page at run-time or do they have to be created in Visual Studio first?

Thanks Mike

War es hilfreich?

Lösung

You can create a new page in the code behind. All you need is a frame to add it to

Page page = new Page();
MainFrame.Navigate(page); // MainFrame is the x:Name of the Frame within XAML
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top