zoukankan      html  css  js  c++  java
  • 【转载】wp7中从墓碑化中重新激活时如何从app.xaml.cs中直接导航到程序的某个页面

      我今天在做个小应用的时候,从墓碑化中重新激活,这个时候在Activity的事件中判断是否有数据,如果有,就要导航到程序中的某个页面(如A页面)。刚开始准备用NavigationService.Navigate()来做,但是在App.xaml.cs中NavigationService被默认为类,所以行不通。问了群里的兄弟才知道在App.xaml.cs中,导航是这样写的:

      

    复制代码
          if (IsolatedStorageSettings.ApplicationSettings.Contains("a"))//判断是否符合条件
    {

    RootFrame.Navigated += new System.Windows.Navigation.NavigatedEventHandler(RootFrame_Navigated);
    }

           void RootFrame_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
      {
       //你需要做的处理及导航
      RootFrame.Navigate(new Uri("/A.xaml", UriKind.Relative));
      RootFrame.Navigated -= RootFrame_Navigated;
      }
    复制代码
  • 相关阅读:
    Pod镜像拉取策略imagePullPolicy
    部署helm服务
    查看k8s中etcd数据
    k8s RBAC实践
    部署k8s集群监控Heapster
    编译k8s1.11 kube-apiserver源码
    阿里云跨地域访问私网
    阿里云ECS搭建harbor1.6.1仓库
    JavaScript
    前端之网络协议、浏览器
  • 原文地址:https://www.cnblogs.com/fx2008/p/2471702.html
Copyright © 2011-2022 走看看