I’m creating an application that uses a wizard.
The wizard is a new Window with its own region named “WizardStepsRegion” where all the steps (views) will be shown there and it has a button that when is pressed it shows a new UserControl (the step 2 of the wizard).
It works well but when I close the wizard window and open it again without closing the application I get the following exception
“RegionCreationException”. An exception occurred while creating a region with name 'WizardStepsRegion'. The exception was: System.ArgumentException: Region with the given name is already registered: WizardStepsRegion.
I’ve created a new simplified application that shows the same error I tried to keep it as simple as possible using the MVVM pattern only in the wizard to simplify the code. The solution can be downloaded from this link
The app is composed of two Windows the shell and the wizard. When you run it you'll see the shell with a button "push me" and when you push it the wizard is opened.
Can someone help me to fix this and tell me why I get that exception the second time I open the Window?
Thank you very much.