在我mainpage.xaml
,我检查了本地存储,如果该方法GetAccept返回假的,我需要重定向到Mentions.xaml
但问题是,的NavigationService在这一步空,所以我赶nullreferenceexecption重定向页面
public MainPage()
{
CacheManager cache = new CacheManager();
if (!cache.GetAccept())
{
NavigationService.Navigate(new Uri("/Views/AppBar/Mentions.xaml", UriKind.RelativeOrAbsolute));
}
InitializeComponent();
}
我该如何做这个重定向?
发件人和事件不被编译器重新识别 – user1428798