Beispiel #1
0
        private void Initialize()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;

            VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
            ResourceRegistrator.Initialization();

            /* Without this user won't be able to input decimal point for float bindings if UpdateSourceTrigger set to PropertyChanged */
            System.Windows.FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;

            unityContainer = new UnityContainer();

            unityContainer.RegisterType <IEventAggregator, EventAggregator>(new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IHudServiceHost, HudServiceHost>(new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IDataService, DataService>(new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <ISettingsService, SettingsService>(new ContainerControlledLifetimeManager(), new InjectionConstructor(StringFormatter.GetAppDataFolderPath()));
            unityContainer.RegisterType <IHandHistoryParserFactory, HandHistoryParserFactoryImpl>();

            UnityServicesBootstrapper.ConfigureContainer(unityContainer);
            ModelBootstrapper.ConfigureContainer(unityContainer);

            var locator = new UnityServiceLocator(unityContainer);

            ServiceLocator.SetLocatorProvider(() => locator);

            RuntimeTypeModel.Default.Add(typeof(System.Windows.Point), false).SetSurrogate(typeof(PointDto));
            RuntimeTypeModel.Default.Add(typeof(System.Windows.Media.Color), false).SetSurrogate(typeof(ColorDto));
            RuntimeTypeModel.Default.Add(typeof(System.Windows.Media.SolidColorBrush), false).SetSurrogate(typeof(SolidColorBrushDto));
        }
 protected override void InitializeContainer(UnityContainer unityContainer)
 {
     unityContainer.RegisterType <IHudLayoutsService, HudLayoutsService>();
     UnityServicesBootstrapper.ConfigureContainer(unityContainer);
     ResourceRegistrator.Initialization();
 }