Silverlight 4 将 ContentPresenter 内容绑定到属性 MVVM Light
我使用 MVVM Light 工具包和 Silverlight 4,我想制作一个小学习项目。我的网络应用程序应包含几个页面,我将在内容演示器中显示这些页面。在我的虚拟机中,我有一个属性 ActualPage。为了设置此属性,我生成了一个 dem ViewModelLocator 的新实例并设置该属性:
ViewModelLocator loc = new ViewModelLocator();
ActualPage = loc.LoginVM;
但是,如果我启动此项目,即使我没有将 contentpresenter 绑定到该属性,如果我打开,Expression Blend 4 和 Internet Explorer 和 Visual Studio 也会崩溃此页面包含虚拟机...
您能帮我解决这个问题吗?
I user MVVM Light toolkit and Silverlight 4 and I want to make a little learning project. My web application should consist of few pages which I will show in a content presenter. In my VM I have a property ActualPage. To set this property I generate a new instance of dem ViewModelLocator and set the property:
ViewModelLocator loc = new ViewModelLocator();
ActualPage = loc.LoginVM;
But if I start this project, even if I don't bind the contentpresenter to the property, Expression Blend 4 and Internet Explorer and Visual Studio crashes if I open this page with the VM...
Can you help me with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我在这里找到了解决方案:
http://www.silverlightshow.net/items/Using-Blend-4-s-new-built-in-TransitionEffects-in-Navigation-and-MVVM-applications.aspx
但是我想知道这是否可以更容易地完成,我认为在 Silverlight 中,与 WPF 的属性相比,它非常复杂?
多米尼克
Ok I have found a solution here:
http://www.silverlightshow.net/items/Using-Blend-4-s-new-built-in-TransitionEffects-in-Navigation-and-MVVM-applications.aspx
But I wonder if this can be done easier, I think in Silverlight it's very complicated in relation to WPF with the property?
Dominik