Pre*_*Fan 3 navigation silverlight
有一个工作正常的页面.只有我做的更改是向页面添加一个数据网格(也添加了xmlns),突然间我得到了Page Not Found.检查了UriMappings.尝试默认导航链接.没有快乐.
想法?
更新:答案是我有一个没有初始化集合的模拟类.请参阅Byrant的答案,了解如何节省一些时间.
要查看问题,您需要对MainPage.xaml.cs进行一次更改:
// If an error occurs during navigation, show an error window
private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
Exception ex = e.Exception;
while (ex.InnerException != null)
{
ex = ex.InnerException;
}
e.Handled = true;
ChildWindow errorWin = new ErrorWindow(ex);
errorWin.Show();
}
Run Code Online (Sandbox Code Playgroud)
在启动应用程序时进行了更改后,您应该看到异常而不是发生异常的页面.
| 归档时间: |
|
| 查看次数: |
1683 次 |
| 最近记录: |