0
我想创建一个包含2个视图和2个视图模型的项目。 其中一个视图将显示我从馈送中获得的人员,另一个将显示我也从馈送收到的天气。项目中的多个视图
在我viewmodellocator构造现在我有 静态ViewModelLocator(){ 集装箱 =新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>();
}
}
然后我设置视图
使用它,但我怎么能增加我的气候有何看法?在我的主要构造函数看起来像这样 public MainViewModel(ICommentService commentsService)
我需要一个额外的参数在构造函数中吗?
将不胜感激,如果有人可以帮助
是的,但我有很多相同视图的实例(只使用不同的url) – reachify 2010-06-25 17:52:09
因此,如果需要,您可以发送带URL的notificationMessage。 – 2010-07-01 07:39:14