本文介绍了ViewModel中的NavigationService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

那我有什么问题?我使用MVVM开发WP应用程序.问题是,我无法在ViewModel中使用NavigationService.网络上有一些有关此问题的文章.我尝试了这个解决方案http://geekswithblogs.net/lbugnion/archive/2011/01/06/navigation-in-a-wp7-application-with-mvvm-light.aspx .工作正常但是只有2种方法和1个事件.原始的NavigationService更复杂.你怎么看?我应该创造更多东西吗?

so what's my problem? I develop WP application using MVVM. Problem is, i cannot use NavigationService in ViewModel. Some articles are on web about this problem. I tried this solutionhttp://geekswithblogs.net/lbugnion/archive/2011/01/06/navigation-in-a-wp7-application-with-mvvm-light.aspx . It's working. But only 2 methods and one event. Original NavigationService is more complex. What do you think? Should I create more things?

其他解决方案:我可以使用PhoneApplicationFrame.Navigate导航到上一页,但是它会创建新实例.

Other solution: I could use PhoneApplicationFrame.Navigate to navigate to previous page, but it creates new instance.

推荐答案


这篇关于ViewModel中的NavigationService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 23:23