Inheritance: SimpleContainer
コード例 #1
0
        protected override void Configure() {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();
            container.PerRequest<PivotPageViewModel>();
            container.PerRequest<TabViewModel>();

            AddCustomConventions();
        }
コード例 #2
0
        protected override void Configure() {
            container = new PhoneContainer(this);

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

            container.RegisterPerRequest<TabViewModel, TabViewModel>();

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

            AddCustomConventions();
        }
コード例 #3
0
        protected override void Configure()
        {
            container = new PhoneContainer();

            container.RegisterSingleton(typeof(MainPageViewModel), "MainPageViewModel", typeof(MainPageViewModel));
            container.RegisterSingleton(typeof(PageTwoViewModel), "PageTwoViewModel", typeof(PageTwoViewModel));
            container.RegisterPerRequest(typeof(TabViewModel), null, typeof(TabViewModel));

            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>();
        }