Change content of WPF Window

What you have to do is to use a UserControl rather than a Window for your replaceable content. Add a new UserControl for each possible content you want to show in this.Content to your project. Add the content you had previously in the second window to the appropriate UserControl. After that you can simply instantiate the new control in your code and assign it to your content area of your main Window.

For example you create a UserControl ctlFinanz with the content of your previous Finanz window. Now you simply write:

this.Content = new ctlFinanz(login);

That's all :-)

Tags:

C#

Wpf