Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I developed a silverlight project with two Modules.(Module1 and Module2) using Microsoft Prism.In Module1 there is a view called Module1View.In Module2 there is a view called Module2View.And in my Shell.xaml ,there are two buttons(Module1View and Module2View).When I click Module1View button it loads the Module1View.After clicking Module1View button I click the Module2View button and then it shows me both ModuleViews(Module1View and Module2View).But I want only one View at one time.
What I want is like this..When I click Module1View button it shoul show me Module1View.Then I click the Module2View button it should show only the Module2View.How can I do this....
Posted

You need to define regions (lets call it "main") in your shell.

Then when a user loads the first module / view, load it in the "main" region.
Then when the user loads the second module / view, remove the first module / view and load the second one in the "main" region.

That is what regions are all about.
 
Share this answer
 
Comments
kasunsm.kt 21-Sep-11 0:51am    
I have 2 quections

1).I'm using only one region("MyRegion"),is it ok..
2).There isn't a method to remove the loaded module..I mean I couldn't find such a method to remove the loaded method..what can I do.
Abhinav S 21-Sep-11 3:43am    
You cannot unload a module. Let the module be loaded.
What you need to do is remove the view, and put in another one.
kasunsm.kt 21-Sep-11 4:27am    
Hi...
Can you tell me how can remove a view like that..Please..
Abhinav S 21-Sep-11 5:08am    
Every region has a Eemove method that you should be able to use.
kasunsm.kt 21-Sep-11 23:11pm    
Thank you very much....
Hi,
I tryied with this

regionManager.Regions["MainRegion"].Remove("Module1View");


but it says, The region manager does not contain the MainRegion region...what can I do for this issue...
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900