c#公共类获取当前页面

c#公共类的时候,没法导航的问题,解决方法:

 private static PhoneApplicationFrame _frame;

      private static PhoneApplicationFrame Frame { get
      {
          return _frame ?? (_frame = (PhoneApplicationFrame) Application.Current.RootVisual);
      } }

    Deployment.Current.Dispatcher.BeginInvoke(() =>
          {
              if (MessageBox.Show(message.ToString(), "", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                  Frame.Navigate(new Uri(url, UriKind.Relative));
          });

 

posted on 2014-06-24 11:21  鸣动我心  阅读(353)  评论(0编辑  收藏  举报