Is it possible in the handler of the Navigating event to change the Uri to which the WebBrowser control is navigating ?
The Uri in the event arguments can not be changed, because it is read only, however, I tried to Cancel the navigation and send the browser to a new address with the Navigate method like this:
// I can not do this.
// e.Uri = new Uri( "http://newUri" );
e.Cancel = true;
( (WebBrowser)sender ).Navigate( new Uri( "http://newUri" ) );
however, this makes my application crash without any exception whatsoever.
Does anybody know a solution to this problem?
It turned out that this is an emulator bug. My approach makes the app running on the emulator crash, but it works properly on a real device.