If you get the error on this line:
WebBrowser.Source = new Uri(URLTextBox.Text, UriKind.Absolute);
Then you need to look at your usage of WebBrowser through your app - because at teh moment there is nothing assigned to it.
Either you forgot to create an instance of the WebBrowser Control at all, or you are executing the code you show above before the instance is created.