问题描述
我想让我的应用用户手动刷新页面。为此,我在应用栏中添加了一个刷新按钮,我在按钮后面写了以下代码...
I want to enable users of my app to manually refresh a page. For this i have included a refresh button in app bar and i have written the following code behind the button...
NavigationService.Navigate(new Uri(" /MainPage.xaml) ?Refresh = true",UriKind.Relative));
NavigationService.Navigate(new Uri("/MainPage.xaml?Refresh=true", UriKind.Relative));
但页面只是第一次刷新。当我第二次点击按钮没有任何反应...
but the page refreshes only for the first time. When i click the button for the second time nothing happens...
任何解决方案?
提前致谢!!
推荐答案
Windows Phone似乎忽略了Refresh或甚至Cache设置。我认为这是因为节省电池。但这很容易规避。而不是附加"?Refresh = true"而不是只需附加一个这样的数字:
Windows Phone seems to ignore the Refresh or even the Cache settings. I think this is due to save battery. But it is easy to circumvent. Instead of appending "?Refresh=true" just append a number like this:
NavigationService.Navigate(new Uri(" /MainPage.xaml?" + DateTime.Now.Ticks,UriKind.Relative));
NavigationService.Navigate( new Uri("/MainPage.xaml?" + DateTime.Now.Ticks, UriKind.Relative) );
- Olli
这篇关于刷新Windows Phone 8页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!