Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the ainject catalog.
        /// </summary>
        private void InitializeAinjectCatalog()
        {
            if (this.catalogInitialized == false)
            {
                this.ainject.RegisterType <ICoordinateGeocoder>(() => new CoordinateGeocoder());

                this.ainject.RegisterType <IDistanceCalculator>(() => new DistanceCalculator());
                this.ainject.RegisterType <ITimeTrackerWorkspace>(() => new TimeTrackerWorkspace(this.ainject.ResolveType <IDistanceCalculator>()));
                ICoreApplicationContext coreApplicationContext = new CoreApplicationContext(this.ainject.ResolveType <ICoordinateGeocoder>(), this.ainject.ResolveType <ITimeTrackerWorkspace>());

                this.ainject.RegisterType(() => coreApplicationContext);
                this.ainject.RegisterType <IPerimeterWatchDog>(() => new PerimeterWatchDog(coreApplicationContext, this.ainject.ResolveType <IDistanceCalculator>(), this.ainject.ResolveType <ITimeTrackerWorkspace>()));

                // Register ViewModels
                this.ainject.RegisterType <ISelectLocationViewModel>(() => new SelectLocationViewModel(this.ainject.ResolveType <ICoreApplicationContext>()));

                this.catalogInitialized = true;
            }
        }
Ejemplo n.º 2
0
 public MoviesController(CoreApplicationContext context)
 {
     _context = context;
 }