刷新页面

Nel*_*eph 4 windows-phone-7

我需要在wp7中刷新页面.在谷歌搜索并得到这个

NavigationService.Navigate(new Uri(NavigationService.Source + "?Refresh=true", UriKind.Relative));
Run Code Online (Sandbox Code Playgroud)

但是当我使用它时会出现错误,即应用程序中断.

如何在wp7中刷新当前页面?

key*_*rdP 9

只需提供唯一的URL ID,它就会重新加载同一页面.您可以生成随机数,但最简单的方法可能是使用GUID.

NavigationService.Navigate(new Uri(string.Format(NavigationService.Source +
                                    "?Refresh=true&random={0}", Guid.NewGuid()));
Run Code Online (Sandbox Code Playgroud)