コード例 #1
0
ファイル: App.xaml.cs プロジェクト: Confuset/7Pass-Remake
        private void RegisterServices()
        {
            _container = new WinRTContainer();
            _container.Activated += TryRegister;
            _container.RegisterWinRTServices();

            _container
                .AssemblyContainingType<MainViewModel>()
                .RegisterViewModels();

#if WINDOWS_PHONE_APP
            _container.Singleton<BackButtonHandler>();
#endif

            _container.Instance(AutoMaps.Initialize());
            _container.Singleton<ICacheService, CacheService>();
            _container.Singleton<IFilePickerService, FilePickerService>();
            _container.Singleton<IRegisteredDbsService, RegisteredDbsService>();

            _container.PerRequest<IEntrySubViewModel, EntryDetailsViewModel>();
            _container.PerRequest<IEntrySubViewModel, EntryNotesViewModel>();
            _container.PerRequest<IEntrySubViewModel, EntryAttachmentsViewModel>();
            _container.PerRequest<IEntrySubViewModel, EntryFieldsViewModel>();
        }