|
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Regions;
using ModuleWorld.View;
using ModuleWorld.ViewModel;
using Microsoft.Practices.Prism.Modularity;
namespace ModuleWorld
{
public class WorldModule : IModule
{
#region IModule Members
private IRegionManager regionManager;
IUnityContainer container;
public void Initialize()
{
this.RegisterViewsAndServices();
if (this.regionManager.Regions.ContainsRegionWithName("WorldRegion"))
{
this.regionManager.Regions["WorldRegion"].Add(this.container.Resolve<IWorldViewModel>().View);
}
}
public WorldModule(IRegionManager regionManager, IUnityContainer container)
{
this.container = container;
this.regionManager = regionManager;
}
#endregion
protected void RegisterViewsAndServices()
{
this.container.RegisterType<IWorldView, WorldView>();
this.container.RegisterType<IWorldViewModel, WorldViewModel>();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.