English 中文(简体)
棱晶导航:在什么地方向统一保管人登记观点/意见书?
原标题:Prism Navigation: where to register View/ViewModels with UnityContainer?

I m 学习如何使用棱镜导航软件,并且需要以下列方式向统一集装箱登记(或ViewModels:

Container.RegisterType<object, HomeView>("HomeView");

见http://blogs.msdn.com/b/kashiffl/archive/201103/10/prism-4-region-navigation- with-silverlight-frame-navigation-and-unity.aspx”rel=“nofollow”>this blog post。 我看到的例子通过<代码>ConfigureContainer()方法,在上登记了这些类型。 但有些实例在<代码>Module类别中登记。 我的问题是:是你在集装箱中登记这些类型的事项?

我的感觉是,在<代码>上登记。 诱杀装置ConfigureContainer()方法将登记类型提供给所有<代码>Modules,而在Module的登记类别中,这些类型只登记在上。 模块

最佳回答

Short answer: No it doesn t mather where you register.

登记他们开诚布公的图书馆。 团结也没有什么不同。

Example 1: Lets say you have ModuleA and ModuleB and you would have an interface in infrastructure. You register this interface to an implementation in ModuleA. You then resolve this instance in moduleB. It would work because you have it configured in moduleA. If you havent, then example 2 is for you.

Example 2: Lets say you have a unregistered type of ClassA. You did not configure this in the bootstrapper or module and you call a resolve on this class. Unity does this automaticly for you and resolves it and it even resolves dependecies if he can find them. There might be one exception. I m not sure about interfaces, I believe if it is not registered to a concrete implementation it cant resolve it.

问题回答

暂无回答




相关问题
combining flipsideview and navigationview

when i am trying to combine flipsideview and navigation view i am getting following error "request for member delegate is something not in a structure or union" on the line controller.delegate = ...

Rails category navigation with tags

I want to create a navigation system for my web application where there are several main categories for articles and several sub tags for each category. For example, in category "Writing" there might ...

Wordpress Navigation

I am working on a Wordpress Theme, I need to work on the navigation, I am having a little trouble creating it. The navigation I am looking for looks like this: www.neu.edu/humanities. I have gotten ...

Silverlight cant find page error

I have started a a new project (to refactor some code), and just can t work out why I keep getting "Can t find page /Index" error. The code works fine until I use an add method (on any collection ...

Zend Framework - multiplate navigation blocks

I want to use the navigation helper to build my navigation menus using Acl. The Acl part I have working fine. I now want to be able to display a few different types of navigation. E.g. admin-nav, ...

Creating a Web Navigation Helper Class for MVC

Im a newbie to MVC and trying to use the web navigator class in my MVC application. http://polymorphicpodcast.com/shows/webnavigator/ The class enables us to have stongly typed urls in a central class ...