I am developing a simple WPF application and I can create a single MainWindow with controls, content, etc.
However, I want to split my app. And I have a problem to build an app with welcome screen where user can choose between two modes, as seen below:
After click on Learn
button I want to load this XAML:
And after click on Next
(from Learn screen) or Recognize
(from Welcome screen) I want to load this XAML:
...everthing in the same MainWindow.
I can't even name what I am trying to achieve. Do I want pages ? Or views ?
How to handle this situation in WPF ?
This you can do it in many ways. Basic thing is place each functionality in different user control, so that you can chose to load them at the run time
Have different user controls and hide all except the first one, depending on the users selections you show the on you want or
Use Content Presenter, depending the user selection load the controls at run time in to the content presenter.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.