I have a main window that displays a usercontrol xaml (WPF form). I would like this to hide while another modeless window shows with a different usercontrol/xaml/WPF form. I have a button to show this modeless window and all is working well, however I want a button that will send me back to the original usercontrol, and this is where I am getting stuck.

Lets say I have Usercontrol1.xaml and I control it's hiding and the loading of Usercontrol2.xaml via the Usercontrol1.xaml.vb.

I have referenced Usercontrol2.xaml as such:

Dim UserPage2 As New Usercontrol2()
Dim UserWin2 As New Window()
UserWin2.Content = UserPage2
Dim ParWin As Window = Me.Parent
ParWin.Visibility = Windows.Visibility.Collapsed
UserWin2.Show()

When I try something similar to return to the original window I get an error and I would guess its because I am trying to recreate a window that I have already created, when what I really want to do it just redisplay it...

Anyone know what I am going on about here?

Can I hide A when I create and load B, then close B and bring back A?