I want to create a project that contains 2 views and 2 viewmodels. One of the views will display persons that i get from a feed and the other will display the weather which I also receive from a feed.
Now in my viewmodellocator constructor I have static ViewModelLocator() { Container = new UnityContainer();
if (ViewModelBase.IsInDesignModeStatic)
{
Container.RegisterType<IPersonService, Design.DesignDataService>();
}
else
{
Container.RegisterType<IPersonService, PersonService>();
}
Container.RegisterType<MainViewModel>(new ContainerControlledLifetimeManager());
}
// Access
public MainViewModel Main
{
get
{
return Container.Resolve<MainViewModel>();
}
}
then I set to use it in the view
But how can I add my weather view? In main my constructor looks like this public MainViewModel(ICommentService commentsService)
do I need an additional parameter in the constructor?
would appreciate if anyone could help