-
Notifications
You must be signed in to change notification settings - Fork 12
/
IocApplicationModule.cs
35 lines (29 loc) · 1.78 KB
/
IocApplicationModule.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Autofac;
using Core;
using SampleApplication.AppServices;
using SampleApplication.Views;
namespace SampleApplication
{
public class IocApplicationModule : Module
{
protected override void Load(ContainerBuilder builder)
{
base.Load(builder);
builder.RegisterType<Repository>().As<IRepository>().AsSelf().SingleInstance();
builder.RegisterType<ShareService>().As<IShareService>().AsSelf();
builder.RegisterType<ContactValidator>().As<IModelValidator<Contact>>().AsSelf();
builder.RegisterType<MainViewModel>().Keyed<IViewModel>(Constants.Navigation.MainPage);
builder.RegisterType<ContactViewModel>().Keyed<IViewModel>(Constants.Navigation.ContactPage);
builder.RegisterType<FirstContactPromptViewModel>().Keyed<IViewModel>(Constants.Navigation.FirstContactPromptPage);
builder.RegisterType<AuthViewModel>().Keyed<IViewModel>(Constants.Navigation.AuthPage);
builder.RegisterType<RegisterViewModel>().Keyed<IViewModel>(Constants.Navigation.RegisterPage);
builder.RegisterType<WelcomeViewModel>().Keyed<IViewModel>(Constants.Navigation.WelcomePage);
builder.RegisterType<MainPage>().Keyed<IView>(Constants.Navigation.MainPage);
builder.RegisterType<WelcomePage>().Keyed<IView>(Constants.Navigation.WelcomePage);
builder.RegisterType<AuthPage>().Keyed<IView>(Constants.Navigation.AuthPage);
builder.RegisterType<RegisterPage>().Keyed<IView>(Constants.Navigation.RegisterPage);
builder.RegisterType<FirstContactPromptPage>().Keyed<IView>(Constants.Navigation.FirstContactPromptPage);
builder.RegisterType(typeof(ContactPage)).Keyed(Constants.Navigation.ContactPage, typeof(IView));
}
}
}