Skip to main content
6 events
when toggle format what by license comment
Feb 4, 2013 at 9:43 comment added Ivan Pintar The controller uses the container to create the views with their viewmodels, so yes, I do use some kind of service location. But it's contained to the controller only, and the views themselves are not looking for their viewmodels, they have them injected. And you could argue that the controller itself serves as kind of a registry for the views. But this is just for the navigation history. As soon as you go back, the current view gets disposed. When you navigate to that view again, a new instance gets created.
Feb 3, 2013 at 22:54 comment added sturdytree thanks again, it's a question of alternatives, and if you wouldn't use a singleton in a container for views and vms, then I can only imagine you would end up with a registry, which seems essentially the same as a service locator?
Feb 3, 2013 at 22:45 history edited Ivan Pintar CC BY-SA 3.0
added 671 characters in body
Feb 3, 2013 at 22:36 comment added Ivan Pintar Well, the only issue I can think of is that it later turns out that you need a second instance of the same view. Check the edit too, it seemed too big for a comment.
Feb 3, 2013 at 21:42 comment added sturdytree thanks, yes if a view can be duplicated, then would not make it (+ related VMs) singleton and would probably use a registry if references to these were required later on. Regarding views that we can navigate away from and forget, then those would also not be singletons. The question was rather where the design implies a single view, then are there any issues you can foresee in making them singletons in a container.
Feb 3, 2013 at 19:24 history answered Ivan Pintar CC BY-SA 3.0