I have a WPF navigator control where I’m trying to do something to the effect of the following so I can clean a URL up before going to the clipboard:
if (webBrowserWorkflows.Source = "http://testinglink.com")
{
// do stuff
}
Unfortunately when I try to do this Visual Studio tells me: “Cannot convert source type string to System.URI”.
With this in mind I’ve tried:
if (webBrowserWorkflows.Source.ToString = "http://testinglink.com")
{
// do stuff
}
However I’ve had no success. As I’m sure you can tell I’m quite new to C# – this is a bit of a testing ground for me so any documention you can provide with an answer to help me to understand that answer would be very much appreciated!
You need to create a new URI object, you can pass your URL into the constructor, this should work:
http://msdn.microsoft.com/en-us/library/system.uri.aspx
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx