Ejemplo n.º 1
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.Singleton <INotesService, NotesService>();
            _container.Singleton <INotesProvider, NotesProvider>();
            _container.Singleton <ILocalStorage, LocalStorage>();
            _container.Singleton <AppNavigationService>();
            _container.Singleton <IInteractionService, InteractionService>();
            _container.Handler <IAppNavigationService>(cnt => cnt.GetInstance <AppNavigationService>());


            _container.PerRequest <ShellViewModel>();
            _container.PerRequest <ShowNotesViewModel>();
            _container.PerRequest <CreateNoteViewModel>();
            _container.PerRequest <FavoriteNotesViewModel>();

            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "Notes.Views",
                DefaultSubNamespaceForViewModels = "Notes.Core.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 2
0
        protected override void Configure()
        {
            // This configures the framework to map between MainViewModel and MainPage
            // Normally it would map between MainPageViewModel and MainPage
            var config = new TypeMappingConfiguration
            {
                IncludeViewSuffixInViewModelNames = false
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

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

            _container.PerRequest <ShellViewModel>();
            _container.PerRequest <MainViewModel>();
            _container.PerRequest <ContentGridDetailViewModel>();
            _container.PerRequest <ContentGridViewModel>();
            _container.PerRequest <MediaPlayerViewModel>();
            _container.PerRequest <DataGridViewModel>();
            _container.PerRequest <ChartViewModel>();
            _container.PerRequest <TabbedPivotViewModel>();
            _container.PerRequest <ImageGalleryDetailViewModel>();
            _container.PerRequest <ImageGalleryViewModel>();
            _container.PerRequest <SettingsViewModel>();
        }
Ejemplo n.º 3
0
        protected override void Configure()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "UIUniversal.Views",
                DefaultSubNamespaceForViewModels = "UIUniversal.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            _container = new WinRTContainer();

            _container.RegisterWinRTServices();
            _container.PerRequest <MainPageViewModel>();
            AddCustomConventions();

            var isStatusBarPresent = ApiInformation.IsTypePresent(typeof(StatusBar).ToString());

            if (isStatusBarPresent)
            {
                StatusBar statusBar = StatusBar.GetForCurrentView();

                // Hide the status bar
                statusBar.HideAsync();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Configure the bootstrapper.
        /// </summary>
        protected override void Configure()
        {
            this.defaultElementLookup     = BindingScope.GetNamedElements;
            BindingScope.GetNamedElements = k =>
            {
                var namedElements = new List <FrameworkElement>();
                namedElements.AddRange(this.defaultElementLookup(k));
                var ribbon = this.LookForRibbon(k);
                if (null != ribbon)
                {
                    this.AppendRibbonNamedItem(ribbon, namedElements);
                }

                return(namedElements);
            };

            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "View",
                DefaultSubNamespaceForViewModels = "ViewModel"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            this.kernel = new StandardKernel();
            this.kernel.Load(Assembly.GetExecutingAssembly());
        }
Ejemplo n.º 5
0
        protected override void Configure()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "RealTimeFaceAnalytics.WPF.Views",
                DefaultSubNamespaceForViewModels = "RealTimeFaceAnalytics.Core.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            _container = new SimpleContainer();

            _container.Singleton <IWindowManager, WindowManager>();
            _container.Singleton <IEventAggregator, EventAggregator>();
            _container.Singleton <IComputerVisionService, ComputerVisionService>();
            _container.Singleton <IEmotionService, EmotionService>();
            _container.Singleton <IFaceService, FaceService>();
            _container.Singleton <IOpenCvService, OpenCvService>();
            _container.Singleton <IVideoFrameAnalyzerService, VideoFrameAnalyzerService>();
            _container.Singleton <IVisualizationService, VisualizationService>();
            _container.Singleton <IDataInsertionService, DataInsertionService>();

            _container.PerRequest <ShellViewModel>();
        }
Ejemplo n.º 6
0
        protected override void Configure()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "Client.Views",
                DefaultSubNamespaceForViewModels = "Common.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

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

            // Register the ViewModels
            container.PerRequest <MainViewModel>();

            MessageBinder.SpecialValues.Add("$account", context =>
            {
                if (context == null || context.EventArgs == null)
                {
                    return(null);
                }

                return
                (((ItemClickEventArgs)context.EventArgs).ClickedItem as AccountViewModel);
            });
        }
Ejemplo n.º 7
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.Singleton <IWeatherService, WeatherService>();
            _container.Singleton <IWeatherProvider, WeatherProvider>();
            _container.Singleton <AppNavigationService>();
            _container.Singleton <IInteractionService, InteractionService>();
            _container.Handler <IAppNavigationService>(cnt => cnt.GetInstance <AppNavigationService>());

            _container.PerRequest <ShellViewModel>();
            _container.PerRequest <HomeViewModel>();
            _container.PerRequest <SecondPageViewModel>();
            _container.PerRequest <ThirdPageViewModel>();


            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "Weather.UWP.Views",
                DefaultSubNamespaceForViewModels = "Weather.Core.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 8
0
        protected override void Configure()
        {
            // This configures the framework to map between MainViewModel and MainPage
            // Normally it would map between MainPageViewModel and MainPage
            var config = new TypeMappingConfiguration
            {
                IncludeViewSuffixInViewModelNames = false
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            _container = new WinRTContainer();
            _container.RegisterWinRTServices();
            _container.PerRequest <FunctionOptimizationGaService>();

            _container.EnablePropertyInjection = true;

            _container.PerRequest <ShellViewModel>();
            _container.PerRequest <MainViewModel>();
            _container.PerRequest <ContentGridDetailViewModel>();
            _container.PerRequest <ContentGridViewModel>();
            _container.PerRequest <ChartViewModel>();
            _container.PerRequest <SettingsViewModel>();
            _container.PerRequest <MutationSettingsViewModel>();
            _container.PerRequest <PopulationSettingsViewModel>();
            _container.PerRequest <CrossoverSettingsViewModel>();
            _container.PerRequest <SelectionSettingsViewModel>();
            _container.PerRequest <RunnersSetViewModel>();
            _container.PerRequest <RunnerInstanceViewModel>();
            _container.PerRequest <ProfileViewModel>();
        }
Ejemplo n.º 9
0
        protected override void Configure()
        {
            // This configures the framework to map between MainViewModel and MainPage
            // Normally it would map between MainPageViewModel and MainPage
            var config = new TypeMappingConfiguration
            {
                IncludeViewSuffixInViewModelNames = false
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

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

            _container.PerRequest <ShellViewModel>();
            _container.PerRequest <MainViewModel>();
            _container.PerRequest <BlankViewModel>();
            _container.PerRequest <WebViewViewModel>();
            _container.PerRequest <MediaPlayerViewModel>();
            _container.PerRequest <MasterDetailViewModel>();
            _container.PerRequest <ContentGridDetailViewModel>();
            _container.PerRequest <ContentGridViewModel>();
            _container.PerRequest <CameraViewModel>();
            _container.PerRequest <InkSmartCanvasViewModel>();
            _container.PerRequest <ImageGalleryDetailViewModel>();
            _container.PerRequest <ImageGalleryViewModel>();
            _container.PerRequest <SettingsViewModel>();
            _container.PerRequest <SchemeActivationSampleViewModel>();
        }
Ejemplo n.º 10
0
        private static void ConfigureTypeMapping()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "BuildingBlocks.Presentation.Views",
                DefaultSubNamespaceForViewModels = "BuildingBlocks.Presentation.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
        private static void ConfigureTypeMapping()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = Consts.Mappings.View,
                DefaultSubNamespaceForViewModels = Consts.Mappings.ViewModel
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 12
0
        protected override void Configure()
        {
            var config = new TypeMappingConfiguration
            {
                IncludeViewSuffixInViewModelNames = false,
                DefaultSubNamespaceForViewModels  = "ViewModel",
                DefaultSubNamespaceForViews       = "View",
                ViewSuffixList = new List <string> {
                    "View", "Page", "Control"
                }
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            var builder = new ContainerBuilder();

            // Register Basic Tools
            builder.RegisterType <WindowManager>()
            .AsImplementedInterfaces()
            .SingleInstance();
            //builder.RegisterType<EventAggregator>()
            //    .AsImplementedInterfaces()
            //    .SingleInstance();
            //builder.RegisterType<FrameAdapter>

            // Register ViewModels
            builder.RegisterType <SelectProcessViewModel>();
            builder.RegisterType <HookConfigViewModel>()
            .SingleInstance();
            builder.RegisterType <GameViewModel>()
            .SingleInstance();
            builder.RegisterType <PreferenceViewModel>()
            .SingleInstance();

            builder.RegisterType <TextViewModel>()
            .SingleInstance();
            builder.RegisterType <HookViewModel>()
            .SingleInstance();
            builder.RegisterType <GeneralViewModel>()
            .SingleInstance();
            builder.RegisterType <AboutViewModel>()
            .SingleInstance();

            // Register Servieces
            builder.RegisterType <SelectProcessService>()
            .AsImplementedInterfaces();
            builder.RegisterType <GameViewDataService>()
            .AsImplementedInterfaces();
            builder.RegisterType <HookSettingPageService>()
            .AsImplementedInterfaces();

            Container = builder.Build();
        }
Ejemplo n.º 13
0
        protected void ConfigureTypeMappings()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = NameSpaceBinding.View,
                DefaultSubNamespaceForViewModels = NameSpaceBinding.ViewModel,
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 14
0
        protected virtual void ConfigureBootstrapper()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = typeof(ShellView).Namespace,
                DefaultSubNamespaceForViewModels = typeof(ShellViewModel).Namespace
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 15
0
        public void ConfigureTypeMappingsShouldThrowWhenDefaultSubNamespaceForViewModelsIsNull()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "not null",
                DefaultSubNamespaceForViewModels = null,
                NameFormat = "not null"
            };

            Assert.Throws <ArgumentException>(() => ViewLocator.ConfigureTypeMappings(config));
        }
Ejemplo n.º 16
0
        public void ConfigureTypeMappingsShouldThrowWhenNameFormatIsEmpty()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "not Empty",
                DefaultSubNamespaceForViewModels = "not Empty",
                NameFormat = string.Empty
            };

            Assert.Throws <ArgumentException>(() => ViewLocator.ConfigureTypeMappings(config));
        }
Ejemplo n.º 17
0
        private static void ConfigureTypeMapping()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "InstantDelivery.Views",
                DefaultSubNamespaceForViewModels = "InstantDelivery.ViewModel"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 18
0
        protected override void ConfigureBootstrapper()
        {
            base.ConfigureBootstrapper();
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "Caliburn.Micro.Training.Wpf.Views",
                DefaultSubNamespaceForViewModels = "Caliburn.Micro.Training.Wpf.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 19
0
        private void ConfigureViewModelLocator()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViewModels = "CallCenter.Client.ViewModels.ViewModels",
                DefaultSubNamespaceForViews      = "CallCenter.Client.WinApp.Views"
            };


            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 20
0
        public AppBootstrapper()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViewModels = "ViewModel",
                DefaultSubNamespaceForViews      = "View"
            };

            ViewModelLocator.ConfigureTypeMappings(config);
            ViewLocator.ConfigureTypeMappings(config);
            Initialize();
        }
Ejemplo n.º 21
0
        protected override void Configure()
        {
            LogManager.GetLog = t => new DebugLog(t);
            var cfg = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViewModels  = "Calculator.WPF.ViewModels",
                DefaultSubNamespaceForViews       = "CalculatorWPFApplication.Views",
                IncludeViewSuffixInViewModelNames = false
            };

            ViewLocator.ConfigureTypeMappings(cfg);
            ViewModelLocator.ConfigureTypeMappings(cfg);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Configures the View-ViewModel type- and
        /// namespace mappings.
        /// </summary>
        protected override void Configure()
        {
            TypeMappingConfiguration map = new TypeMappingConfiguration()
            {
                DefaultSubNamespaceForViewModels = "Scrubbler.ViewModels",
                DefaultSubNamespaceForViews      = "Scrubbler.Views"
            };

            ViewLocator.ConfigureTypeMappings(map);
            ViewLocator.AddSubNamespaceMapping("Scrubbler.ViewModels.ScrobbleViewModels", "Scrubbler.Views.ScrobbleViews");
            ViewLocator.AddSubNamespaceMapping("Scrubbler.ViewModels.SubViewModels", "Scrubbler.Views.SubViews");
            ViewModelLocator.ConfigureTypeMappings(map);
        }
Ejemplo n.º 23
0
        protected override void Configure()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "Views",
                DefaultSubNamespaceForViewModels = "ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            _DependencyInjector = DependencyInjector.Instance;
        }
Ejemplo n.º 24
0
        public App()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "Views",
                DefaultSubNamespaceForViewModels = "Core.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            this.Dispatcher.UnhandledException += OnDispatcherUnhandledException;
        }
Ejemplo n.º 25
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "GoodMovie.Views",
                DefaultSubNamespaceForViewModels = "GoodMovie.ViewModels.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
            RegisterViewModels();
            RegisterServices();
        }
        protected override void ConfigureContainer(ContainerBuilder builder)
        {
            builder.RegisterType <LoginViewModel>().As <ILoginViewModel>().SingleInstance();
            builder.RegisterType <NavigationViewModel>().As <INavigationViewModel>().SingleInstance();


            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "ClinicApp.Views",
                DefaultSubNamespaceForViewModels = "ClinincApp.ViewModel.Members"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);
        }
Ejemplo n.º 27
0
        protected override void Configure()
        {
            // This configures the framework to map between MainViewModel and MainPage
            // Normally it would map between MainPageViewModel and MainPage
            var config = new TypeMappingConfiguration
            {
                IncludeViewSuffixInViewModelNames = false
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            _container = new WinRTContainer();
            _container.RegisterWinRTServices();
        }
        protected override void OnStartup(object sender, StartupEventArgs e)
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViewModels = typeof(MainWindowViewModel).Namespace,
                DefaultSubNamespaceForViews      = typeof(MainWindowView).Namespace
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            base.OnStartup(sender, e);

            DisplayRootViewFor <IMainWindowViewModel>();
        }
        protected override void Configure()
        {
            var config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "UserInterface.Views",
                DefaultSubNamespaceForViewModels = "Presentation.ViewModels"
            };

            ViewLocator.ConfigureTypeMappings(config);
            ViewModelLocator.ConfigureTypeMappings(config);

            var builder = new ContainerBuilder();

            ConfigureContainer(builder);
            container = builder.Build();
        }
        /// <summary>
        /// Override to configure the framework and setup your IoC container.
        /// </summary>
        protected override void Configure()
        {
            container = new SimpleContainer();

            container.Singleton <IWindowManager, WindowManager>();
            container.Singleton <IEventAggregator, EventAggregator>();
            container.PerRequest <IShell, MainWindowViewModel>();

            TypeMappingConfiguration config = new TypeMappingConfiguration
            {
                DefaultSubNamespaceForViews      = "WindKomponentenZerlegung",
                DefaultSubNamespaceForViewModels = "Common.ViewModels"
            };

            ViewModelLocator.ConfigureTypeMappings(config);
            ViewLocator.ConfigureTypeMappings(config);
        }