Ejemplo n.º 1
0
        static ContainerRegister()
        {
            RegisterMultiThreadConfiguration(true);

            container
            .Singleton(container)
            .Singleton <ICommandFactory, CommandFactory>()
            .Singleton(() => new CommandsDiscover(EvaluateExecuteCommandFactoryHalper.Create(true)))
            //.Singleton(() => new CommandsDiscover(AlwaysCanExecuteCommandFactoryHalper.Create(true, new DefaultViewModelChecker("Validation errors on UI", "Check the UI"))))
            .Singleton <IMessageBroker, LocalMessageBroker>()
            .Singleton <IDialogService, DefaultDialogService>()
            .Singleton <IMapper, AutoMapperMapper>()
            .Singleton(typeof(ServiceFactory <>))
            .Singleton <IMessageBox, LoggingMessageBox>()
            .Singleton(typeof(IDisposableFactory <>), typeof(DemoProxyFactory <>))
            .Singleton <CommandConvention, DemoCommandConvention>();

            TimerFactory.Set(new DispatcherTimerFactory());
            CollectionFactory.Set(() => new SafeCollectionFactory());
            CommandsDiscoverFactory.Set(container.Resolve <CommandsDiscover>);
            MessageBroker.Set(container.Resolve <IMessageBroker>);
            DialogService.Set(container.Resolve <IDialogService>);
            Mapper.Set(container.Resolve <IMapper>);
            ViewModelController.Set(() => container);
        }
Ejemplo n.º 2
0
		public virtual void Inizialize()
		{
			locator = CreateServiceLocator();

			locator
				.Singleton<ILogger, SimpleLogger>()
				.Singleton<ILogger, AdvancedLogger>();
		}
Ejemplo n.º 3
0
        public virtual void Inizialize()
        {
            locator = CreateServiceLocator();

            locator
            .Singleton <ILogger, SimpleLogger>()
            .Singleton <ILogger, AdvancedLogger>();
        }