简体   繁体   English

Frame.Navigate不起作用

[英]Frame.Navigate not working

I recently added a new page in the project and am trying to Navigate to it through a button click event using Frame.Navigate(typeof()). 我最近在项目中添加了一个新页面,并尝试使用Frame.Navigate(typeof())通过按钮单击事件导航到该页面。 It isn't working. 它不起作用。 The code runs and compiles with no errors and I've even added breakpoints to see whether it's executing the Navigate statement. 该代码可以正常运行和编译,并且没有错误,甚至添加了断点以查看其是否正在执行Navigate语句。 It does but it's returning false. 确实有,但返回的是假。 The page stays as is. 该页面保持不变。 I then tried replacing it to another page which was originally there in my project and the statement ran just fine for that. 然后,我尝试将其替换为项目中最初存在的另一页,并且该语句就可以很好地运行了。 Please Help! 请帮忙!

It is hard to figure out the problem with given description. 很难通过给定的描述来解决问题。 But, you can handle the NavigationFailed event to respond to navigation failure or You can handle the failure directly in the event handler, or you can set the NavigationFailedEventArgs.Handled property to true and use the Navigate method return value to respond to the failure. 但是,您可以处理NavigationFailed事件以响应导航失败,也可以直接在事件处理程序中处理失败,或者可以将NavigationFailedEventArgs.Handled属性设置为true并使用Navigate方法的返回值来响应失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM