IRegion Deactivate vs Remove

Topics: Prism v4 - WPF 4
Jun 15, 2010 at 7:10 PM
Edited Jun 15, 2010 at 7:11 PM

Lets say I have a "MainRegion" with three associated views (Data, Graphs, Specifications). When I hit the Graphs TabItem, the GraphsView is loaded into the MainRegion. When I hit the Specifications TabItem, the SpecificationsView is loaded into the MainRegion, etc..

When I say loaded I mean I call region.add(view) and region.activate(view).

Now say I am going from DataView to GraphsView, how should I proceed. Keep in mind I will most likely be coming back to the DataView shortly and I don't want to run through my DataView's InitializeComponent() again. Should I region.remove(DataView) and region.deactivate(DataView)? Or should I just deactivate?

Sorry but I can't find any good explanation of the two in the documentation. Thanks in advance.

Jun 23, 2010 at 3:09 PM


You can find an explanation about the difference between deactivating and removing a view in this thread.

Additionally, take into account that, if you have removed a view, you don’t need to deactivate it, as it is no longer in your region.

I hope you find this helpful.

Guido Leandro Maliandi