首页 > 代码库 > c#公共类获取当前页面

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));          });