protected override void Configure()
        {
            _container = new WinRTContainer();

            _container.RegisterWinRTServices();

            _container.PerRequest<MainPageViewModel>();

            _container.RegisterSingleton(typeof(IPageNavigationService), "IPageNavigationService", typeof(PageNavigationService));
            _container.RegisterSingleton(typeof(IUserNotificationService), "IUserNotificationService", typeof(UserNotificationService));
        }
示例#2
0
        protected override void Configure()
        {
            LogManager.GetLog = t => new DebugLog(t);

            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.RegisterPerRequest(typeof(IMessageService), null, typeof(DefaultMessageService));

            _container.RegisterInstance(typeof(IResourceLoader), null, new DefaultResourceLoader());
            _container.RegisterSingleton(typeof(IGitHubService), null, typeof(GhService));

            _container
                .PerRequest<MainViewModel>()
                    .PerRequest<NewsViewModel>()
                    .PerRequest<RepositoriesViewModel>()
                    .PerRequest<FollowersViewModel>()
                    .PerRequest<FollowingViewModel>()
                    .PerRequest<OrgsListViewModel>()
                .PerRequest<RepositoryViewModel>()
                    .PerRequest<RepositoryCommitsViewModel>()
                    .PerRequest<RepositoryIssuesViewModel>()
                    .PerRequest<RepositoryInfoViewModel>()
                    .PerRequest<RepositoryContentsViewModel>()
                .PerRequest<OrgViewModel>()
                    .PerRequest<MembersViewModel>()
                .PerRequest<AboutViewModel>()
                .PerRequest<AuthorizeViewModel>()
                .PerRequest<HtmlUrlViewModel>();
        }
示例#3
0
        protected override void Configure()
        {
            base.Configure();

            _container = new WinRTContainer(RootFrame);
            _container.RegisterWinRTServices();
            _container.RegisterSingleton(typeof(IUiService), null, typeof(UiService));
        }
示例#4
0
        protected override void Configure()
        {
            _container = new WinRTContainer();

            _container.RegisterWinRTServices();

            _container.PerRequest<MainPageViewModel>();
            _container.PerRequest<ContactViewModel>();
            _container.PerRequest<EventViewModel>();
            _container.PerRequest<PennyViewModel>();

            _container.RegisterSingleton(typeof(IPageNavigationService), "IPageNavigationService", typeof(PageNavigationService));
            _container.RegisterSingleton(typeof(IContactService), "IContactService", typeof(ContactService));
            _container.RegisterSingleton(typeof(IUserNotificationService), "IUserNotificationService", typeof(UserNotificationService));

            _container.RegisterSingleton(typeof(IPhinugService), "IPhinugService", typeof(PhinugService));

            _container.RegisterSingleton(typeof(IMapLauncher), "IMapLauncher", typeof(MapLauncher));
        }
示例#5
0
        protected override void Configure()
        {
            MessageBinder.SpecialValues.Add("$clickeditem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);

            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container.PerRequest<MainViewModel>();
            container.RegisterSingleton(typeof(IDialogService),null,typeof(DialogService));

            PrepareViewFirst();
        }
示例#6
0
        protected override void Configure()
        {
            base.Configure();

            // create the container
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            // repositories
            _container.RegisterSingleton(typeof (ISessionRepository), null, typeof (JsonSessionRepository));
            _container.RegisterSingleton(typeof (ISpeakerRepository), null, typeof (JsonSpeakerRepository));
            _container.RegisterSingleton(typeof (IChangeRepository), null, typeof (JsonChangeRepository));
            _container.RegisterSingleton(typeof(ISettingsRepository), null, typeof(ApplicationSettingsRepository));

            // non frame services
            _container.RegisterSingleton(typeof (IAppService), null, typeof (CodemashApplicationService));
            _container.RegisterSingleton(typeof(INotificationRegistrationService), null, typeof(CodemashNotificationRegistrationService));
        }
示例#7
0
		protected override async void Configure()
		{
			container = new WinRTContainer();
			container.RegisterWinRTServices();
			container.Singleton<LoggingManager>();
			container.Singleton<IAppSettings, ApplicationSettings>();
			container.Singleton<TimerService>();
			container.Singleton<ThermostatManager>();

			var types = GetType().GetTypeInfo().Assembly.GetTypes()
				.Where(t => t.Namespace == "Sannel.House.Controller.ViewModels");
			foreach (var type in types)
			{
				var typeInfo = type.GetTypeInfo();
				if (!typeInfo.IsAbstract)
				{
					var sa = typeInfo.GetCustomAttribute<SingletonAttribute>();
					if(sa != null)
					{
						container.RegisterSingleton(type, type.FullName, type);
					}
					else
					{
						container.RegisterPerRequest(type, type.FullName, type);
					}
				}
			}
		}