I would like to make a test , first of all redirecting to a blank page and then just after redirecting to a normal page, but it looks like it doesnt make the second redirect …
Browser.Base = Constants.ParkInfoDirectory; // "ParkInfo" folder
string s = string.Format("{0}/section_{1}.html", _parkId, _parkPage);
// URL = "/ParkInfo/ti217/5" for page 5 of Rainier
string blank = string.Format("{0}/Blank.html", _parkId);
Browser.Navigate(new Uri(blank, UriKind.Relative));
this.Browser.UpdateLayout();
Browser.Navigate(new Uri(s, UriKind.Relative));
this.Browser.UpdateLayout();
New version :
string s = string.Format("{0}/section_{1}.html", _parkId, _parkPage); // URL = "/ParkInfo/ti217/5" for page 5 of Rainier
string blank = string.Format("{0}/section_blank.html", _parkId);
Uri blank_ = new Uri(blank, UriKind.Relative);
Browser.Navigate(new Uri(blank, UriKind.Relative));
Browser.Navigated += new EventHandler<System.Windows.Navigation.NavigationEventArgs>(Browser_Navigated);
{
if (e.Uri == blank_)
{
Browser.Navigate(new Uri(s, UriKind.Relative));
}
};
Browser.Navigate(blank_);
You call two navigate method in one
UI threadexecution. It can cause some issues with that. Try to put secondNavigateinsideDispatcherto delay it execution or subscribe toNavigatedevent and call secondNavigatefrom itOr: