【问题标题】:Replacement of NavigationService.Navigate in Universal AppUniversal App中NavigationService.Navigate的替换
【发布时间】:2015-03-10 14:36:39
【问题描述】:

我正在将项目从 windows phone 8.1 迁移到 windows 通用应用程序。 windows phone 8.1 NavigationService 可以在 Universal App 中使用多种导航方法实现,例如 Frame.Navigate(typeof(MainPage));或 Frame.Navigate(typeof(MainPage), param); 但是,我没有将 MainPage 作为 .XAML 页面,而是以字符串形式构建运行时 URI,并在末尾附加查询字符串。 windows phone 8.1 中提供了类似的 API 字符串 strpath = "aaaaaaa"; NavigationService.Navigate(new Uri(strPath, UriKind.RelativeOrAbsolute));

但在 Universal App 中找不到 windows phone 8.1 NavigationService.Navigate(new Uri( .. ) ) 的替代品。

请帮忙.....

【问题讨论】:

    标签: navigationservice


    【解决方案1】:

    对于 WinRT 平台,没有开箱即用的 NavigationService API 替代品。最好的方法是使用 MVVM-light 框架中提供的 NavigationService(使用类型),或者您可以自己构建一个(提供 url 并将其转换为类型)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-29
      • 2016-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-20
      相关资源
      最近更新 更多