tags:

views:

248

answers:

1

Hi

I'm new to the Hyperlink control. I wish to have a hyperlink in a regular WPF window which will navigate to a URL by opening the standard browser. I have added the hyperlink, but it does nothing. I guess it was a bit much to hope for.

Before I implement a handler to do the work myself, can anyone please confirm that the Hyperlink control will navigate only within pages?

Thanks

+6  A: 

You will need to do it yourself.

The simplest way to do it is to handle the Hyperlink.RequestNavigate event and call Process.Start with the URL. (This will open the default browser).

SLaks
Thanks, just what I needed!
Tor Haugen
I would just add that if you plan on having several hyperlinks in your application that it would be wise to handle the Hyperlink.RequestNavigate event as a routed event rather than hook the event on every single Hyperlink instance.
Drew Marsh