문제

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

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top