|
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using ModulHello.View;
using ModulHello.ViewModel;
namespace ModulHello
{
public class HelloModule : IModule
{
#region IModule Members
private IRegionManager regionManager;
IUnityContainer container;
public void Initialize()
{
this.RegisterViewsAndServices();
if (this.regionManager.Regions.ContainsRegionWithName("HelloRegion"))
{
this.regionManager.Regions["HelloRegion"].Add(this.container.Resolve<IHelloViewModel>().View);
}
}
public HelloModule(IRegionManager regionManager, IUnityContainer container)
{
this.container = container;
this.regionManager = regionManager;
}
#endregion
protected void RegisterViewsAndServices()
{
this.container.RegisterType<IHelloView, HelloView>();
this.container.RegisterType<IHelloViewModel, HelloViewModel>();
}
}
}
|
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.