private void RegisterViewModels()
 {
     _container.PerRequest <MainScreenViewModel>();
     _container.PerRequest <MainContentViewModel>()
     .PerRequest <AllViewModel>()
     .PerRequest <ItemViewModel>();
 }
示例#2
0
 protected override void Configure()
 {
     container = new WinRTContainer();
     container.RegisterWinRTServices();
     container.PerRequest <ITalao, Talao>();
     container.PerRequest <IMultasRealizadas, MultasRealizadas>();
 }
示例#3
0
        public override void ConfigureContainer(WinRTContainer container)
        {
            container
            .PerRequest <LoggedOutApplicationMode>()
            .PerRequest <LoggedInApplicationMode>();

            container
            .Singleton <ICentronService, CentronService>()
            .Singleton <IHelpdeskGroupsService, HelpdeskGroupsService>()
            .Singleton <IQueryExecutor, QueryExecutor>()
            .Singleton <IQueryCache, QueryCache>()
            .Singleton <ICommandQueue, CommandQueue>()
            .Singleton <IScriptEngine, ScriptEngine>();

            container
            .PerRequest <IQueryHandler <HelpdeskGroupQuery, IList <HelpdeskPreview> >, HelpdeskGroupQueryHandler>()
            .PerRequest <IQueryHandler <SearchCustomersQuery, IList <CustomerPreview> >, SearchCustomersQueryHandler>()
            .PerRequest <IQueryHandler <HelpdeskTypesQuery, IList <HelpdeskType> >, HelpdeskTypesQueryHandler>()
            .PerRequest <IQueryHandler <HelpdeskStatesQuery, IList <HelpdeskState> >, HelpdeskStatesQueryHandler>();

            container
            .PerRequest <ICommandHandler <ChangeHelpdeskStateCommand, Unit>, ChangeHelpdeskStateCommandHandler>();

            var scriptEngine = container.GetInstance <IScriptEngine>();

            scriptEngine.AddGlobalMethod("contains", (Func <string, string, bool>)((s1, s2) => (s1 ?? string.Empty).IndexOf(s2, StringComparison.OrdinalIgnoreCase) >= 0));
        }
示例#4
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);
        }
示例#5
0
        protected override void Configure()
        {
            _container = new WinRTContainer();

            _container.RegisterWinRTServices();

            _container.PerRequest <MainViewModel>();
            _container.PerRequest <AboutViewModel>();
            _container.PerRequest <AugmentedViewModel>();
            _container.PerRequest <CurrentMapViewModel>();
            _container.PerRequest <LocationListViewModel>();
            _container.PerRequest <SignUpViewModel>();
            _container.PerRequest <SignInViewModel>();
            _container.PerRequest <ResetPasswordViewModel>();
            _container.PerRequest <AddPointOfInterestViewModel>();
            _container.PerRequest <CreatePointOfInterestViewModel>();
            _container.Singleton <IPointOfInterestService, PointOfInterestService>();
            _container.Singleton <ILocationService, LocationService>();
            _container.Singleton <IAccountService, AccountService>();
            _container.Singleton <IHttpService, HttpService>();
            _container.Singleton <IUserDataStorageService, UserDataStorageService>();
            IoC.GetInstance = GetInstance;

            HideStatusBar();
        }
示例#6
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);
        }
示例#7
0
        protected override void Configure()
        {
            _container = new WinRTContainer();

            _container.RegisterWinRTServices();
            _container.PerRequest <IRssService, RssService>();
            _container.PerRequest <MainViewModel>();
        }
示例#8
0
        protected override void Configure()
        {
            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container.PerRequest <MainPageViewModel>();
            container.PerRequest <DetailPageViewModel>();
        }
示例#9
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.PerRequest<MainPageViewModel>();
            _container.PerRequest<CategoryDetailViewModel>();
            _container.Singleton<ICategoriesService, CategoriesService>();
        }
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.PerRequest <MainViewModel>();
            _container.PerRequest <DatasheetViewModel>();

            SettingsPane.GetForCurrentView().CommandsRequested += SettingCommandsRequested;
        }
        protected override void Configure()
        {
            base.Configure();

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

            container.PerRequest <SettingsViewModel>();
            container.PerRequest <DialogViewModel>();
        }
示例#12
0
        private void RegisterViewModels()
        {
            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container.PerRequest <LoginPageViewModel>();
            container.PerRequest <MenuPageViewModel>();
            container.PerRequest <TravelingPageViewModel>();
            container.PerRequest <ViaggioSelectionPageViewModel>();
        }
示例#13
0
        protected override void Configure()
        {
            container = new WinRTContainer();

            container.RegisterWinRTServices();

            MessageBinder.SpecialValues.Add("$clickeditem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);

            container.PerRequest <MainPageViewModel>();
            container.PerRequest <DetailPageViewModel>();
        }
示例#14
0
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();
            container.RegisterSharingService();
            container.PerRequest <TestApp.RT.AppViewModel>();

            container.PerRequest <FileExplorer.Views.FileListView>();

            //TODO: Register your view models at the container
        }
示例#15
0
        protected override void Configure()
        {
            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container.PerRequest <HomeViewModel>();
            container.PerRequest <CommentThreadViewModel>();

            container.Singleton <IAnalytics, Analytics>();
            container.Singleton <ICrashReporter, NullCrashReporter>();
            container.Singleton <IHackerNewsClient, HackerNewsHtmlClient>();
        }
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();


            container.PerRequest <MainViewModel>();
            container.PerRequest <DetailViewModel>();

            container.Singleton <IDataManager, DataManagerOnlinerTech>();
            container.Singleton <IWriteReadData, LocalDataManager>();

            MessageBinder.SpecialValues.Add("$clickeditem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);
        }
示例#17
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container.PerRequest <CitiesViewModel>();
            _container.PerRequest <CityDetailsViewModel>();
            _container.PerRequest <CitiesMapViewModel>();
            _container.PerRequest <ShellViewModel>();
            _container.PerRequest <SettingViewModel>();
            //   _container.PerRequest<MainViewModel>();

            _container.Singleton <INavigationManager, NavigationManager>();
        }
示例#18
0
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container.RegisterSharingService();

            container.RegisterSettingsService()
                .RegisterFlyoutCommand<SampleSettingsViewModel>("Custom");

            container
                .PerRequest<ActionsViewModel>()
                .PerRequest<BindingsViewModel>()
                .PerRequest<CoroutineViewModel>()
                .PerRequest<ExecuteViewModel>()
                .PerRequest<MenuViewModel>()
                .PerRequest<NavigationTargetViewModel>()
                .PerRequest<NavigationViewModel>()
                .PerRequest<SampleSettingsViewModel>()
                .PerRequest<SearchViewModel>()
                .PerRequest<SettingsViewModel>()
                .PerRequest<SetupViewModel>()
                .PerRequest<ShareSourceViewModel>()
                .PerRequest<ShareTargetViewModel>();
        }
示例#19
0
        protected override void Configure()
        {
            LogManager.GetLog = t => new DebugLog(t);

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

            container.RegisterSharingService();

            var settingsService = container.RegisterSettingsService();
                
            settingsService.RegisterFlyoutCommand<SampleSettingsViewModel>("Custom");
            settingsService.RegisterUriCommand("View Website", new Uri("http://caliburnmicro.codeplex.com"));

            container
                .PerRequest<ActionsViewModel>()
                .PerRequest<BindingsViewModel>()
                .PerRequest<CoroutineViewModel>()
                .PerRequest<ExecuteViewModel>()
                .PerRequest<MenuViewModel>()
                .PerRequest<NavigationTargetViewModel>()
                .PerRequest<NavigationViewModel>()
                .PerRequest<SampleSettingsViewModel>()
                .PerRequest<SearchViewModel>()
                .PerRequest<SettingsViewModel>()
                .PerRequest<SetupViewModel>()
                .PerRequest<ShareSourceViewModel>()
                .PerRequest<ShareTargetViewModel>()
                .PerRequest<ConventionsViewModel>()
                .PerRequest<HubViewModel>();

            // We want to use the Frame in OnLaunched so set it up here

            PrepareViewFirst();
        }
示例#20
0
        protected override void Configure()
        {
            LogManager.GetLog = t => new DebugLog(t);

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

            _container.RegisterPerRequest(typeof(IMessageService), null, typeof(DefaultMessageService));

            _container.RegisterInstance(typeof(IResourceLoader), null, new DefaultResourceLoader());
            _container.RegisterSingleton(typeof(IGitHubService), null, typeof(GhService));

            _container
            .PerRequest <MainViewModel>()
            .PerRequest <NewsViewModel>()
            .PerRequest <RepositoriesViewModel>()
            .PerRequest <FollowersViewModel>()
            .PerRequest <FollowingViewModel>()
            .PerRequest <OrgsListViewModel>()
            .PerRequest <RepositoryViewModel>()
            .PerRequest <RepositoryCommitsViewModel>()
            .PerRequest <RepositoryIssuesViewModel>()
            .PerRequest <RepositoryInfoViewModel>()
            .PerRequest <RepositoryContentsViewModel>()
            .PerRequest <OrgViewModel>()
            .PerRequest <MembersViewModel>()
            .PerRequest <AboutViewModel>()
            .PerRequest <AuthorizeViewModel>()
            .PerRequest <HtmlUrlViewModel>();
        }
示例#21
0
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();

            container.RegisterSharingService();

            container.RegisterSettingsService()
            .RegisterFlyoutCommand <SampleSettingsViewModel>("Custom");

            container
            .PerRequest <ActionsViewModel>()
            .PerRequest <BindingsViewModel>()
            .PerRequest <CoroutineViewModel>()
            .PerRequest <ExecuteViewModel>()
            .PerRequest <MenuViewModel>()
            .PerRequest <NavigationTargetViewModel>()
            .PerRequest <NavigationViewModel>()
            .PerRequest <SampleSettingsViewModel>()
            .PerRequest <SearchViewModel>()
            .PerRequest <SettingsViewModel>()
            .PerRequest <SetupViewModel>()
            .PerRequest <ShareSourceViewModel>()
            .PerRequest <ShareTargetViewModel>();
        }
示例#22
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();
            }
        }
示例#23
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);
            });
        }
示例#24
0
        protected override void Configure()
        {
            var baseGetLog = LogManager.GetLog;

            LogManager.GetLog = t => t == typeof(ViewModelBinder) ? new DebugLog(t) : baseGetLog(t);

            ConfigureSpecialValues();

            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container
            .Singleton <ISchemeStorageService, SchemeStorageService>()
            .Singleton <IWindowManager, WindowManager>()
            .Singleton <IBitmapService, BitmapService>()
            .Singleton <ITileService, TileService>()
            .Singleton <IAppSettingsService, AppSettingsService>();

            container
            .PerRequest <SchemeListViewModel>()
            .PerRequest <EditSchemeViewModel>();

            container.RegisterSharingService();

#if WINDOWS_PHONE_APP
            var statusBar = StatusBar.GetForCurrentView();

            statusBar.HideAsync();
#endif

            var tileService = container.GetInstance <ITileService>();

            tileService.Initialise();
        }
示例#25
0
 protected override void Configure()
 {
     _container = new WinRTContainer();
     _container.RegisterWinRTServices();
     _container.Singleton <IE.Mobile.Forms.App>();
     _container.PerRequest <IPlayAudio, AudioService>();
 }
示例#26
0
        protected override void Configure()
        {
            LogManager.GetLog = t => new DebugLog(t);

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

            container.RegisterSharingService();

            var settingsService = container.RegisterSettingsService();

            settingsService.RegisterFlyoutCommand <SampleSettingsViewModel>("Custom");
            settingsService.RegisterUriCommand("View Website", new Uri("http://caliburnmicro.codeplex.com"));

            container
            .PerRequest <ActionsViewModel>()
            .PerRequest <BindingsViewModel>()
            .PerRequest <CoroutineViewModel>()
            .PerRequest <ExecuteViewModel>()
            .PerRequest <MenuViewModel>()
            .PerRequest <NavigationTargetViewModel>()
            .PerRequest <NavigationViewModel>()
            .PerRequest <SampleSettingsViewModel>()
            .PerRequest <SearchViewModel>()
            .PerRequest <SettingsViewModel>()
            .PerRequest <SetupViewModel>()
            .PerRequest <ShareSourceViewModel>()
            .PerRequest <ShareTargetViewModel>()
            .PerRequest <ConventionsViewModel>()
            .PerRequest <HubViewModel>();

            // We want to use the Frame in OnLaunched so set it up here

            PrepareViewFirst();
        }
示例#27
0
        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping("Hubb.App.UWP.Views", "Hubb.Core.ViewModels");
            ViewLocator.AddNamespaceMapping("Hubb.Core.ViewModels", "Hubb.App.UWP.Views");

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

            container.Instance <IGitHubClient>(new GitHubClient(new ProductHeaderValue("hubb-uwp", "1.0.0")));

            container
            .Singleton <IAppNavigationService, AppNavigationService>()
            .Singleton <IAuthenticationService, AuthenticationService>()
            .Singleton <IRepositoryService, RepositoryService>();

            container
            .PerRequest <LoginViewModel>()
            .PerRequest <RepositorySearchViewModel>();

            Coroutine.Completed += (s, e) =>
            {
                if (e.Error == null)
                {
                    return;
                }

                Debug.Write(e.Error.Message);
            };

            ConventionManager.AddElementConvention <AutoSuggestBox>(AutoSuggestBox.TextProperty, "Text", "QuerySubmitted");
        }
示例#28
0
        protected override void Configure()
        {
            container = new WinRTContainer();
            container.RegisterWinRTServices();

            //TODO: Register your view models at the container
            container.PerRequest<FaultedSensorsViewModel>();
        }
示例#29
0
        protected override void Configure()
        {
            container = new WinRTContainer();

            container.RegisterWinRTServices();
            container.PerRequest <MainViewModel>();
            container.PerRequest <DetailViewModel>();

            if (Execute.InDesignMode)
            {
                container.PerRequest <IFeedService, FakeFeedService>();
            }
            else
            {
                container.PerRequest <IFeedService, FeedService>();
            }
        }
示例#30
0
        protected override void Configure()
        {
            _container = new WinRTContainer();

            _container.RegisterWinRTServices();

            // Make sure to register your containers here
            _container.PerRequest<ViewModels.IShellViewModel, ViewModels.ShellViewModel>();
        }
示例#31
0
 protected override void Configure()
 {
     _container = new WinRTContainer();
     _container.RegisterWinRTServices();
     _container.PerRequest <ShellViewModel>()
     .PerRequest <AccountTabViewModel>()
     .PerRequest <ValidateTabViewModel>();
     _eventAggregator = _container.GetInstance <IEventAggregator>();
 }
示例#32
0
        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping("Hello.Xamarin.Windows.Views", "Hello.Xamarin.Core.ViewModels");

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

            container
            .PerRequest <LoginViewModel>();
        }
示例#33
0
        protected override void Configure()
        {
#if DEBUG
            LogManager.GetLog = type => new CaliburnDebugLogger(type);
#endif

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

            _container.Singleton <GattInformationProvider>().GetInstance <GattInformationProvider>().Initialize();

            _container.Singleton <InfoManager>();
            _container.Instance(new CommandRunner());
            _container.Singleton <EventTracer>();
            _container.Singleton <CharacteristicSubscriptionService>();
            _container.Singleton <DeviceController>();

            _container.Singleton <CommandPanelViewModel>();

            _container.Singleton <Services.ApplicationSettings>();
            _container.Singleton <ApplicationState>();

            _container
            .PerRequest <MainViewModel>()
            .PerRequest <DeviceShellViewModel>()
            .PerRequest <SettingsViewModel>()
            .PerRequest <SelectDeviceViewModel>()
            .PerRequest <AboutViewModel>();

            _container
            .PerRequest <ICommandFormatter, ReadFormatter>()
            .PerRequest <ICommandFormatter, WriteFormatter>()
            .PerRequest <ICommandFormatter, ReadClientConfigDescriptorFormatter>()
            .PerRequest <ICommandFormatter, WriteClientConfigDescriptorFormatter>()
            .PerRequest <ICommandFormatter, SubscribeFormatter>()
            .PerRequest <ICommandFormatter, UnsubscribeFormatter>()
            .PerRequest <ICommandFormatter, ConnectDeviceFormatter>()
            .PerRequest <ICommandFormatter, DisconnectDeviceFormatter>();

            var tracer = _container.GetInstance <EventTracer>();

            _eventAggregator = _container.GetInstance <IEventAggregator>();
        }
示例#34
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container
            .PerRequest <HomeViewModel>();

            _eventAggregator = _container.GetInstance <IEventAggregator>();
        }
示例#35
0
        protected override void Configure()
        {
            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            _container
                .PerRequest<ShellViewModel>()
                .PerRequest<DeviceViewModel>();

            _eventAggregator = _container.GetInstance<IEventAggregator>();
        }
示例#36
0
        protected override void Configure()
        {
            MessageBinder.SpecialValues.Add("$clickeditem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);

            ViewModelLocator.AddNamespaceMapping("Caliburn.Micro.HelloPortable.Views", "Caliburn.Micro.HelloPortable.Portable.ViewModels");
           
            
            container = new WinRTContainer();

            container.RegisterWinRTServices();

            container.PerRequest<MainViewModel>();

            PrepareViewFirst();
        }
示例#37
0
        protected override void Configure()
        {
            MessageBinder.SpecialValues.Add("$clickeditem", c => ((ItemClickEventArgs)c.EventArgs).ClickedItem);

            var gitHubClient = new GitHubClient(
                new ProductHeaderValue("Caliburn.Micro.State", "1.0"),
                new InMemoryCredentialStore(Credentials.Anonymous));

            _container = new WinRTContainer();

            _container.RegisterWinRTServices();

            _container.Instance<IGitHubClient>(gitHubClient);

            _container
                .PerRequest<RepositorySearchViewModel>()
                .PerRequest<RepositoryDetailsViewModel>();
        }