Does anyone know where the views are instantiated in a WP7 app?
Are they instantiated by the Silverlight Navigation Framework? Is the SL Nav Framework responsible for instantiating views as well as navigation?
Or are the views instantiated somewhere else and the nav framework just obtains the reference of view instances? And if so, is it possible for me to take control of view instantiation and instantiate them from a DI container?
To directly answer your question, there is no way that I know of to override the creation of view objects.
In XAML programming, however, it is considered best practice to use a ViewModel (a combination of a Controller and Model with added change tracking on the properties). The ViewModel stack typically works like this (going back from the view):
DataContext="{Binding PageNameViewModel, Source={Static ViewModelLocator}}"Application.ResourcesinApp.xaml, and is provided with a DI container by App.xaml.cs during startupFor more information, search “MVVM Windows Phone” or check out the following projects: