What is the difference between registering a region and adding a region to a prism?

I want to create a region with dynamic views (several views in one region). The contents of the region must be changed using the ComboBox selection event (comobox elements are view instances). I want the change in ComboBox to change the view in the region to the selected view element.

My question is: what is the difference between:

MyView view= new MyView();
IRegion region = new Region();  
region.Name="MyRegion";  
regionManager.Regions.Add(region);
region.Add(view);
region.Activate(view);

To:

regionManager.RegisterViewWithRegion("MyRegion",type(MyView));

?

What is the best way to use dynamic areas?

+4
source share
3 answers
+3

. .

? ServiceLocator Container (MEF, Unity, , ). .

, ( ). (, ), .

, (RegisterViewWithRegion). !

+3

? , , Singleton, . MSDN:

, RegisterViewWithRegion() : . , , , . PrismLibrary.

, . RequestNavigate(), , .

MSDN:

, , .

+1

Source: https://habr.com/ru/post/1527212/


All Articles