A custom IoC container which integrates with the phone and properly registers all Caliburn.Micro services.
Inheritance: SimpleContainer, IPhoneContainer
Esempio n. 1
0
        protected override void Configure()
        {
            container = new PhoneContainer();
            container.RegisterPhoneServices(RootFrame);
            container.Singleton<MainViewModel>();
            container.Singleton<StationsViewModel>();
            container.PerRequest<HostPageViewModel>();
            container.Singleton<FavoritesViewModel>();
            container.Singleton<InfoViewModel>();
            container.Singleton<NavigationStartViewModel>();
            container.Singleton<NavigationViewModel>();
            container.Singleton<DebugLog>();
            container.Singleton<SystemConfigViewModel>();
            container.Singleton<StationMapViewModel>();
            container.Singleton<AboutViewModel>();
            container.Singleton<RentTimerViewModel>();
            container.Singleton<CityContextViewModel>();
            container.Singleton<VersionHistoryViewModel>();
            container.Singleton<AppInfoViewModel>();
#if DEBUG && !ANALYTICS
            container.Singleton<IAnalyticsService, NullAnalyticsService>();
            container.Singleton<ILoggingService, NullLoggingService>();
            //Caliburn.Micro.LogManager.GetLog = type => new DebugLog(type);
#else
            container.Singleton<IAnalyticsService, AnalyticsService>();
            container.Singleton<ILoggingService, LoggingService>();
#endif
            AddCustomConventions();
        }
Esempio n. 2
0
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);
            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<RecentsViewModel>();
            container.PerRequest<ContactsViewModel>();
            container.PerRequest<TrainerFrontViewModel>();
            container.PerRequest<SettingsPageViewModel>();
            container.PerRequest<ContactEditPageViewModel>();
            container.PerRequest<ContactDetailsPageViewModel>();
            container.PerRequest<GroupPageViewModel>();
            container.PerRequest<ActiveCallPageViewModel>();
            container.PerRequest<CallLogPageViewModel>();
            container.PerRequest<NetworkTestPageViewModel>();
            container.PerRequest<WelcomePageViewModel>();

            container.PerRequest<GroupDialogViewModel, GroupDialogViewModel>();
            container.PerRequest<IncomingCallDialogViewModel, IncomingCallDialogViewModel>();
            container.Singleton<SettingsModel>();
            container.Singleton<UDCListModel>();
            container.Singleton<Connection>();
            container.Singleton<EchoClientLogic>();

            AddCustomConventions();
        }
        protected override void Configure()
        {
            container = new PhoneContainer();

#if DEBUG
            LogManager.GetLog = type => new DebugLogger(type);
#endif

            if (!Execute.InDesignMode)
            {
                container.RegisterPhoneServices(RootFrame);
            }

            PerformAsyncInitializationsAsync().GetAwaiter().GetResult();

            // Application Insights: http://msdn.microsoft.com/en-us/library/dn481095.aspx

            container.RegisterPerRequest(typeof(IConfigurationService), null, typeof(DefaultConfigurationService));
            container.RegisterPerRequest(typeof(IDataService), null, typeof(DefaultDataService));
            container.RegisterPerRequest(typeof(ILocationService), null, typeof(DefaultLocationService));
            container.RegisterPerRequest(typeof(IUIService), null, typeof(DefaultUIService));

            container.RegisterPerRequest(typeof(IEchtzeitdatenService), null, typeof(OgdEchtzeitdatenService));
            container.RegisterPerRequest(typeof(IRoutingService), null, typeof(OgdRoutingService));

            container.PerRequest<MainPageViewModel>();
            container.PerRequest<MenuViewModel>();
            container.PerRequest<TrafficInfoViewModel>();
            container.PerRequest<FavoritesViewModel>();

            container.PerRequest<StationsPivotPageViewModel>();
            container.PerRequest<StationsListViewModel>();
            container.PerRequest<StationsSearchViewModel>();
            container.PerRequest<NearbyStationsViewModel>();

            container.PerRequest<LinesPivotPageViewModel>();
            container.PerRequest<MetroViewModel>();
            container.PerRequest<TramViewModel>();
            container.PerRequest<BusViewModel>();
            container.PerRequest<NightBusViewModel>();

            container.PerRequest<LineInfoPageViewModel>();

            container.PerRequest<MapNearbyStationsPageViewModel>();

            container.PerRequest<StationInfoPivotPageViewModel>();
            container.PerRequest<DepartureViewModel>();

            container.PerRequest<RoutingPageViewModel>();
            container.PerRequest<NewRouteViewModel>();
            container.PerRequest<StationSelectorViewModel>();
            container.PerRequest<RouteHistoryViewModel>();

            container.PerRequest<TripsViewModel>();

            container.PerRequest<SettingsPageViewModel>();
            container.PerRequest<AboutPageViewModel>();

            AddCustomConventions();
        }
Esempio n. 4
0
 protected override void Configure()
 {
     container = new PhoneContainer(RootFrame);
     container.RegisterPhoneServices();
     container.PerRequest<MainPageViewModel>();
     container.PerRequest<ItemViewModel>();
 }
Esempio n. 5
0
        protected override void Configure()
        {
            container = new PhoneContainer();

            // Language display initialization
            InitializeLanguage();
            if (!Execute.InDesignMode)
                container.RegisterPhoneServices(RootFrame);

            container.Singleton<MainPageViewModel>();
            container.Singleton<ServerViewModel>();
            container.PerRequest<ThreadListViewModel>();
            container.PerRequest<PostViewModel>();
            container.Singleton<IUserService, UserViewModel>();

            container.Singleton<IIndicator, Indicator>();
            container.Singleton<IErrorMsg, ErrorMsg>();
            //container.Singleton<IResourceService, ApplicationResourceService>();
            container.Singleton<IResourceService, NetResourceService>();
            container.Singleton<IDataService, DataService>();
            container.Singleton<IStorageHelper, IsolatedStorageHelper>();
            container.Singleton<IParserFactory, DZParserFactory>();
            container.Singleton<IOrientationHelper, OrientationHelper>();

            GalaSoft.MvvmLight.Threading.DispatcherHelper.Initialize();
            ImageTools.IO.Decoders.AddDecoder<ImageTools.IO.Gif.GifDecoder>();

#if WP8
            RootFrame.Navigating += RootFrame_Navigating;
            RootFrame.Navigated += RootFrame_Navigated;
#endif
            AddCustomConventions();
        }
Esempio n. 6
0
        protected override void Configure() {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();

            container.Singleton<ExceptionViewModel>();
            container.Singleton<ConnectionQueryViewModel>();

            container.Singleton<DepartureViewModel>();
            container.Singleton<FavoriteStationsViewModel>();
            container.Singleton<SearchStationsViewModel>();
            container.Singleton<NearbyStationsViewModel>();

            container.Singleton<MainPageViewModel>();
            container.Singleton<SettingsViewModel>();
            container.Singleton<HistoryViewModel>();
            container.Singleton<SearchViewModel>();
            container.PerRequest<ConnectionViewModel>();
            container.PerRequest<DetailViewModel>();
            container.Singleton<StationsViewModel>();

            container.PerRequest<MessageViewModel>();
            container.PerRequest<DialogViewModel>();

            AddCustomConventions();
        }
Esempio n. 7
0
        public Bootstrapper()
        {
            this.container = new PhoneContainer(this.RootFrame);

            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<MainMenuViewModel>();
            container.PerRequest<MoviesLandingViewModel>();
            container.PerRequest<MovieTitleListViewModel>();
            container.PerRequest<MovieViewModel>();
            container.PerRequest<SettingsViewModel>();
            container.PerRequest<TvshowsLandingViewModel>();
            container.PerRequest<RemoteViewModel>();
            container.PerRequest<GenreViewModel>();
            container.PerRequest<MovieGenresSelectorViewModel>();
            container.PerRequest<TvshowSeasonsViewModel>();
            container.PerRequest<TvEpisodeListViewModel>();
            container.PerRequest<TvEpisodeViewModel>();
            container.PerRequest<AboutViewModel>();
            container.PerRequest<ConnectionsViewModel>();
            container.PerRequest<ConnectionViewModel>();
            container.PerRequest<RecentlyAddedMoviesViewModel>();

            container.RegisterSingleton(typeof(SettingsHost), null, typeof(SettingsHost));

            container.RegisterSingleton(typeof(ICache), null, typeof(Cache));
            container.RegisterSingleton(typeof(IXbmcHost), null, typeof(XbmcHost));
            container.RegisterSingleton(typeof(IProgressService), null, typeof(ProgressService));


            AddCustomConventions();

            LogManager.GetLog = _ => new Logger();
        }
Esempio n. 8
0
        protected override void Configure()
        {
            container = new PhoneContainer();
            container.RegisterPhoneServices(RootFrame);

            container.Singleton<Forms.App>();
        }
Esempio n. 9
0
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);
            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<ItemViewModel>();

            #region GUID Generation and PushNotification Channel Establishing
            if (IsolatedStorageSettings.ApplicationSettings.Contains("DeviceId"))
            {
                phoneId = (Guid)IsolatedStorageSettings.ApplicationSettings["DeviceId"];
            }
            else
            {
                phoneId = Guid.NewGuid();
                IsolatedStorageSettings.ApplicationSettings["DeviceId"] = phoneId;
            }
            //manager = new NotificationManager();
            //manager.SetupNotificationChannel();
            #endregion

            if (IsolatedStorageSettings.ApplicationSettings.Contains("Username") && IsolatedStorageSettings.ApplicationSettings.Contains("Password"))
            {
                username = (string)IsolatedStorageSettings.ApplicationSettings["Username"];
                password = (string)IsolatedStorageSettings.ApplicationSettings["Password"];
                loggedIn = true;
            }
        }
Esempio n. 10
0
        protected override void Configure()
        {
            _container = new PhoneContainer();

            _container.RegisterPhoneServices(RootFrame);

            _container.PerRequest<HomePageViewModel>();
        }
        protected override void Configure()
        {
            _container = new PhoneContainer();

            _container.RegisterPhoneServices(RootFrame);

            AddCustomConventions();
        }
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);
            container.RegisterPhoneServices();
            
            container.PerRequest<MainPageViewModel>();

            Caliburn.Micro.WP71.Recipes.ExternalModules.ExternalModuleLoader.Initialize();
        }
        protected override void Configure()
        {
            container = new PhoneContainer();

#if DEBUG
            LogManager.GetLog = type => new DebugLogger(type);
#endif

            container.RegisterPhoneServices(RootFrame);

            var initTasks = new Task(() => PerformAsyncInitializationsAsync());
            initTasks.RunSynchronously();

            container.RegisterPerRequest(typeof(IConfigurationService), null, typeof(DefaultConfigurationService));
            container.RegisterPerRequest(typeof(IDataService), null, typeof(DefaultDataService));
            container.RegisterPerRequest(typeof(ILocationService), null, typeof(DefaultLocationService));
            container.RegisterPerRequest(typeof(IUIService), null, typeof(DefaultUIService));

            // container.RegisterPerRequest(typeof(IEchtzeitdatenService), null, typeof(CreateCampEchtzeitdatenService));
            container.RegisterPerRequest(typeof(IEchtzeitdatenService), null, typeof(OgdEchtzeitdatenService));
            container.RegisterPerRequest(typeof(IRoutingService), null, typeof(OgdRoutingService));

            container.PerRequest<MainPageViewModel>();
            container.PerRequest<MenuViewModel>();
            container.PerRequest<TrafficInfoViewModel>();
            container.PerRequest<FavoritesViewModel>();

            container.PerRequest<StationsPivotPageViewModel>();
            container.PerRequest<StationsListViewModel>();
            container.PerRequest<StationsSearchViewModel>();
            container.PerRequest<NearbyStationsViewModel>();

            container.PerRequest<LinesPivotPageViewModel>();
            container.PerRequest<MetroViewModel>();
            container.PerRequest<TramViewModel>();
            container.PerRequest<BusViewModel>();
            container.PerRequest<NightBusViewModel>();

            container.PerRequest<LineInfoPageViewModel>();

            container.PerRequest<MapNearbyStationsPageViewModel>();

            container.PerRequest<StationInfoPivotPageViewModel>();
            container.PerRequest<DepartureViewModel>();

            container.PerRequest<RoutingPageViewModel>();
            container.PerRequest<NewRouteViewModel>();
            container.PerRequest<StationSelectorViewModel>();
            container.PerRequest<RouteHistoryViewModel>();

            container.PerRequest<TripsViewModel>();

            container.PerRequest<SettingsPageViewModel>();
            container.PerRequest<AboutPageViewModel>();

            AddCustomConventions();
        }
Esempio n. 14
0
 protected override void Configure()
 {
     container = new PhoneContainer(this);
     container.RegisterPerRequest(typeof(IRealtimeStopVisitsService), null, typeof(RealtimeStopVisitsService));
     container.RegisterPerRequest(typeof(IRealtimeStopsService), null, typeof(RealtimeStopsService));
     container.RegisterPerRequest(typeof(StopsViewViewModel), "StopsViewModel", typeof(StopsViewViewModel));
     container.RegisterPerRequest(typeof(RealtimeResultsViewModel), "RealtimeResultsViewModel", typeof(RealtimeResultsViewModel));
     container.RegisterInstance(typeof(INavigationService), null, new FrameAdapter(RootFrame));
 }
Esempio n. 15
0
        protected override void Configure()
        {
            _container = new PhoneContainer();
            _container.RegisterPhoneServices(RootFrame);

            _container.Instance(RootFrame);

            _container.Singleton<ICache, FileSystemCache>();
            
            // View Models
            _container.Singleton<SplashViewModel>();
            _container.Singleton<AboutViewModel>();
            _container.Singleton<ShellViewModel>();
            _container.Singleton<MyBoardsViewModel>();
            _container.Singleton<MyCardsViewModel>();
            _container.Singleton<MyNotificationsViewModel>();
            _container.Singleton<ProfileViewModel>();

            _container.PerRequest<BoardViewModel>();
            _container.PerRequest<BoardListViewModel>();
            _container.PerRequest<CardViewModel>();
            _container.PerRequest<CardDetailPivotViewModel>();
            _container.PerRequest<CardDetailOverviewViewModel>();
            _container.PerRequest<CardDetailChecklistViewModel>();
            _container.PerRequest<CardDetailAttachmentsViewModel>();
            _container.PerRequest<CardDetailMembersViewModel>();
            _container.PerRequest<ChecklistViewModel>();
            _container.PerRequest<ChecklistItemViewModel>();
            _container.PerRequest<AttachmentViewModel>();
            _container.AllTransientTypesOf<NotificationViewModel>();

            // Event handlers
            _container.AllSingletonTypesOf<AbstractHandler>();

            // Services
            _container.PerRequest<Services.IApplicationBar, DefaultApplicationBar>();
            _container.Singleton<INetworkService, NetworkService>();
            _container.Singleton<IProgressService, ProgressService>();
            _container.Singleton<ITrelloApiSettings, TrelloSettings>();
            
#if DISCONNECTED
            _container.Singleton<IRequestClient, JsonFileRestClient>();
#else
            _container.Singleton<IRequestClient, TrelloRestClient>();
#endif
            var network = _container.Get<INetworkService>();
            var client = AugmentClient(_container);
            var trello = new Trello(network, client);
            _container.Instance<ITrello>(trello);

            PhoneToolkitConventions.Install();
            TelerikConventions.Install();

            // Force creation
            _container.InstantiateInstancesOf<AbstractHandler>();
        }
Esempio n. 16
0
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.Instance<IProgressService>(new ProgressService(RootFrame));

            AddCustomConventions();
        }
Esempio n. 17
0
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);
            container.RegisterPhoneServices();

            container.PerRequest<MainPageViewModel>();

            ViewLocator.NameTransformer.AddRule(typeof(File).FullName, typeof(FileView).FullName);
            ViewLocator.NameTransformer.AddRule(typeof (Folder).FullName, typeof (FolderView).FullName);
        }
Esempio n. 18
0
        protected override void Configure()
        {
            container = new PhoneContainer();

            container.RegisterPhoneServices(RootFrame);
            foreach (var vm in App.GetViewModelTypes())
                container.RegisterPerRequest(vm, null, vm);

            AddCustomConventions();
        }
 protected override void Configure()
 {
     container = new PhoneContainer();
     if (!Execute.InDesignMode)
         container.RegisterPhoneServices(RootFrame);
     container.PerRequest<MainPageViewModel>();
     container.PerRequest<IGoogleApiService, GoogleApiService>();
     container.PerRequest<PizzernatorDataContext>();
     container.PerRequest<RestaurantPreviewViewModel>();
 }
Esempio n. 20
0
        protected override void Configure()
        {
            container = new PhoneContainer();
            container.RegisterPhoneServices(RootFrame);
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<ItemViewModel>();

            container.PerRequest<IFileStorageService, PhoneFileStorageService>();
            container.PerRequest<IGoogleAnalytics, GoogleAnalyticsWrapper>();
        }
Esempio n. 21
0
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<SettingsViewModel>();

            AddCustomConventions();
        }
Esempio n. 22
0
        protected override void Configure()
        {
            container = new PhoneContainer();
            if (!Execute.InDesignMode)
                container.RegisterPhoneServices(RootFrame);

            container.PerRequest<MainPageViewModel>();

            AddCustomConventions();
        }
        protected override void Configure() {
            container = new PhoneContainer();
            container.RegisterPhoneServices(RootFrame);
            container.Singleton<IMessageService, MessageService>();

            //NOTE: don't register anything from the module assemblies here
            container.PerRequest<MainPageViewModel>();
            
            //NOTE: install the conventions
            ModuleConventions.Install();
        }
Esempio n. 24
0
        protected override void Configure()
        {
            container = new PhoneContainer(this);

            container.RegisterPhoneServices();
            container.RegisterAllViewModelsForPages();

            //container.InstallChooser<PhoneNumberChooserTask, PhoneNumberResult>();
            //container.InstallLauncher<EmailComposeTask>();

            AddCustomConventions();
        }
Esempio n. 25
0
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<SpeakViewModel>();
            container.PerRequest<ListenViewModel>();
            container.PerRequest<DownloadPanoramaItemViewModel>();

            AddCustomConventions();
        }
Esempio n. 26
0
        protected override void Configure()
        {
            _container = new PhoneContainer();

            // register Coding4FunWindowManager BEFORE calling RegisterPhoneServices
            _container.Singleton<IWindowManager, Coding4FunWindowManager>();

            _container.RegisterPhoneServices(RootFrame);

            _container.PerRequest<MainPageViewModel>();
            _container.PerRequest<DialogViewModel>();
        }
Esempio n. 27
0
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.Singleton<SettingsPageViewModel>();
            container.PerRequest<TFSDataServiceContext>();
            container.PerRequest<RecentProjectsViewModel>();
            container.PerRequest<AllProjectsViewModel>();

            AddCustomConventions();
        }
        protected override void Configure()
        {
            _phoneContainer = new PhoneContainer();
            _phoneContainer.RegisterPhoneServices(RootFrame);
            _phoneContainer.PerRequest<MainPageViewModel>();
            _phoneContainer.PerRequest<PledgeViewModel>();
            _phoneContainer.PerRequest<ChallengeViewModel>();
            _phoneContainer.PerRequest<CharitiesViewModel>();

            ConventionManager.AddElementConvention<BindableAppBarMenuItem>(Control.IsEnabledProperty, "DataContext", "Click");
            ConventionManager.AddElementConvention<BindableAppBarButton>(Control.IsEnabledProperty, "DataContext", "Click");
            ConventionManager.AddElementConvention<DatePicker>(DateTimePickerBase.ValueProperty, "Value", "SelectedDate");
        }
        protected override void Configure()
        {
            container = new PhoneContainer(this);

            container.RegisterSingleton(typeof(MainPageViewModel), "MainPageViewModel", typeof(MainPageViewModel));
            container.RegisterSingleton(typeof(PageTwoViewModel), "PageTwoViewModel", typeof(PageTwoViewModel));
            
            container.RegisterInstance(typeof(INavigationService), null, new FrameAdapter(RootFrame));
            container.RegisterInstance(typeof(IPhoneService), null, new PhoneApplicationServiceAdapter(PhoneService));

            container.Activator.InstallChooser<PhoneNumberChooserTask, PhoneNumberResult>();
            container.Activator.InstallLauncher<EmailComposeTask>();
        }
Esempio n. 30
0
        protected override void Configure()
        {
            if (Execute.InDesignMode) return;
            container = new PhoneContainer();

            container.RegisterPhoneServices(RootFrame);
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<SettingsPageViewModel>();
            AddCustomConventions();

            PhoneService.Launching += new EventHandler<LaunchingEventArgs>(PhoneService_Launching);
            PhoneService.Activated += new EventHandler<ActivatedEventArgs>(PhoneService_Activated);
        }