|
Rank: Advanced Member Groups: Member
Joined: 7/17/2015 Posts: 51
|
Dear Support Team, I'm having trouble avoiding back or forward navigation in your latest version. In older versions I avoided back or forward navigation in your browser by using the following code:
Code:
private void BeforeNavigateHandler (object sender, BeforeNavigateEventArgs e) { if (e.NavigationType == NavigationType.BackOrForward) { e.Cancel = true; return; } }
But BeforeNavigateEventArgs.NavigationType does not exist anymore. How can I avoid back or forward navigation in your latest version? Neither comparing e.NewUrl with e.OldUrl nor e.IsRedirect works in my case. Thank you in advance for some information! Best Regards!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
Sorry about the delay. We were trying to confirm the details before responding. We have confirmed that NavigationType will be brought back in our up coming 2020 release. Currently we are doing some final testing on this release and it is expected to be out in less than 2 weeks.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi, We have posted our 2020 build that added this property. Note that in order to disable back/forward, you will need to handle both BeforeNavigate and LoadFailed event. When you set e.Cancel to true in BeforeNavigate it will eventually cause the request to be cancelled. This will cause LoadFailed event. If you do not handle this event, it will result in the default "this request has been cancelled" error message to be displayed. You can use the following code to avoid this:
Code: C#
private void WebView_LoadFailed(object sender, LoadFailedEventArgs e)
{
if (e.Task.ErrorCode == ErrorCode.Canceled)
e.ShouldShowError = false;
}
Hope this helps. Please feel free to let us know if you have any more questions. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 7/17/2015 Posts: 51
|
Hi,
thanks for your reply! With the new version it's working again.
Best regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Great. Thanks for confirming the fix!
|
|