silverlight - Prism regions not displaying registered views -


I am using PRISM in the Silverlight 4 application. I have a problem where the registered views in some areas are not displayed.

When I load a module at the startup, I register some ideas in the fields as follows:

  Regional Manager RegisterWeviath Region ("Myregean 1", TypeF (IMISubvi1) ); Regional Manager. Registrar Visual Policy ("Myregan 2", Typef (IMISUB VV2));  

I have a view to implement an interface called IMyView, where xaml has two content controls with defined areas in a grid like this:

  & lt; ContentControl Area: Regional Manager. Regeneration name = "Myregean 1" horizontal conference alignment = "statch" vertical content alignment = "stitch" grid. Rows = "0" grid. Rowspan = "1" /> & Lt; Content Control Area: Regional Manager Regeneration = "Myregean 2" horizontal conference alignment = "statch" vertical content alignment = "stitch" grid. Rau = "1" grid. Rowspan = "1" />  

I have tried two different ways to add the view of the main area. Both scenes and basic elements such as buttons are displayed, but the areas defined in the scene do not get filled with related ideas.

Method 1:

  Object obj = _container.Resolve & lt; IMyView & gt; (); IRegion Main Region = _regionManager.Regions ["MainViewRegion"]; IRegionManager scoped = Main Regions Add (obj, "test", true); MainRegion.Activate (obj); // Enabling the following calls will fail to say that the area MyRegion1 does not exist. Like it seems? // IRegion myRegion = scoped.Regions ["MyRegion1"];  

Method 2:

  object obj = _container.Resolve & lt; IMyView & gt; (); _regionManager.AddToRegion ("MainViewRegion", obj); . _regionManager.Regions ["MainViewRegion"] active (obj);  

It seems that the defined areas in the xaml file are not registered, and this does not display registered views.

The main Wydragon is defined in the tab content in shell in this form:

   

Any suggestions for solving my problem would be greatly appreciated!

I am facing the same problem The idea is that in the areas already prepared To see the injection for any reason, {Main Regions. Update (obje, "test", true)} does not show the scene. A work area for me is to create an area with code, and then to inject the view. Something like this:

Microsoft.Practices.Composite.Presentation.regions.RegionManager.SetRegionManager (Headregeian Container, _RegionManager); Microsoft.Practices.Composite.Presentation.regions.RegionManager.SetRegionName (headerRegionContainer, regionName);

var view = _UnityContainer.Resolve (bag.HeaderViewType); _RegionManager.Regions [regionName] .Add (see); _RegionManager.Regions [regionName] Activate (see);

Unfortunately for me I can not reach my goal in this way, but maybe you can.

Regards,

Levente


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -