Ejemplo n.º 1
0
        public App()
        {
            Services = ConfigureServices();
            ShardSharpCore.Init(Services);

            InitializeComponent();

            MainPage = new AppShell();
        }
Ejemplo n.º 2
0
        private static IServiceProvider ConfigureServices()
        {
            var services = new ServiceCollection();

            // Add Services
            services.AddSingleton <IAppInit, AppInit>();
            services.AddSingleton <IDatabaseReloadDisplayService, DatabaseReloadDisplayService>();
            services.AddSingleton <IDataRepositoryManager, DataRepositoryManager>();

            //     services.AddSingleton<IFirstRunDisplayService, FirstRunDisplayService>();

            services.AddSingleton <IGrampsStoreSerial, GrampsStoreSerial>();

            //      services.AddSingleton<IMessenger, WeakReferenceMessenger>();

            //     services.AddSingleton<ISharedLogging, SharedLogging>();
            //     services.AddSingleton<ISharedMessageLog, SharedMessageLog>();
            services.AddSingleton <IStoreFile, StoreFile>();
            services.AddSingleton <IStorePostLoad, StorePostLoad>();
            services.AddSingleton <IStoreXML, StoreXML>();

            //       services.AddSingleton<IWhatsNewDisplayService, WhatsNewDisplayService>();

            // Viewmodels
            services.AddTransient <AboutViewModel>();
            services.AddTransient <AddressDetailViewModel>();
            services.AddTransient <AttributeDetailViewModel>();

            services.AddTransient <BookMarkListViewModel>();

            services.AddTransient <ChildRefDetailViewModel>();
            services.AddTransient <CitationDetailViewModel>();
            services.AddTransient <CitationListViewModel>();

            services.AddTransient <DateRangeDetailViewModel>();
            services.AddTransient <DateSpanDetailViewModel>();
            services.AddTransient <DateStrDetailViewModel>();
            services.AddTransient <DateValDetailViewModel>();

            services.AddTransient <EventDetailViewModel>();
            services.AddTransient <EventListViewModel>();

            services.AddTransient <FamilyDetailViewModel>();
            services.AddTransient <FamilyListViewModel>();
            services.AddTransient <FileInputHandlerViewModel>();
            services.AddTransient <FirstRunViewModel>();

            services.AddTransient <HubViewModel>();

            services.AddTransient <MediaDetailViewModel>();
            services.AddTransient <MediaListViewModel>();

            services.AddTransient <NeedDatabaseReloadViewModel>();
            services.AddTransient <NoteDetailViewModel>();
            services.AddTransient <NoteListViewModel>();

            services.AddTransient <PeopleGraphViewModel>();
            services.AddTransient <PersonBirthdayViewModel>();
            services.AddTransient <PersonDetailViewModel>();
            services.AddTransient <PersonListViewModel>();
            services.AddTransient <PersonNameDetailViewModel>();
            services.AddTransient <PlaceDetailViewModel>();
            services.AddTransient <PlaceListViewModel>();

            services.AddTransient <RepositoryDetailViewModel>();
            services.AddTransient <RepositoryRefDetailViewModel>();
            services.AddTransient <RepositoryListViewModel>();

            services.AddTransient <SearchPageViewModel>();
            services.AddTransient <SettingsViewModel>();
            services.AddTransient <SourceDetailViewModel>();
            services.AddTransient <SourceListViewModel>();

            services.AddTransient <TagDetailViewModel>();
            services.AddTransient <TagListViewModel>();

            services.AddTransient <WhatsNewViewModel>();

            services.AddTransient <NavigationPage>();

            ShardSharpCore.InitServicesAdd(ref services);

            return(services.BuildServiceProvider());
        }