【发布时间】:2013-12-13 05:13:34
【问题描述】:
我有一个 C#/XAML Windows 应用商店应用程序,我需要能够在恢复处理程序中执行一些网络/RESTful API 测试,以确保令牌/会话仍然有效。如果不是,应用程序需要将用户引导回登录页面。
我在 SO 上尝试了多种解决方案,但由于某种原因,它们无法在 App.xaml.cs 中运行。首要问题似乎是我无法从恢复处理程序中访问 Frame.Navigate。
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
Application.Current.Resuming += new EventHandler<object>(OnResuming);
}
private async void OnResuming(object sender, object e)
{
bool success = true;
// some tests are performed here
if (!success) { /* what do I use here? */ }
}
我在以下页面上尝试了解决方案:
【问题讨论】:
标签: c# windows-store-apps winrt-xaml