2

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:

Welcome screen

After click on Learn button I want to load this XAML:

Learn mode

And after click on Next (from Learn screen) or Recognize (from Welcome screen) I want to load this XAML:

Recognize mode

...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 ?

1 Answer 1

1

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

  1. Have different user controls and hide all except the first one, depending on the users selections you show the on you want or

  2. Use Content Presenter, depending the user selection load the controls at run time in to the content presenter.

Sign up to request clarification or add additional context in comments.

1 Comment

The first way is so simple but so effective. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.