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 Mai开发者_StackOverflow社区nViewModel 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
Personally, I don't register my Views with my container - only my ViewModels. I typically only have a single instance of any view, so I just create a new instance inside of it's parent ViewModel.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论