Tor Haugen
Tor Haugen

Reputation: 19627

Do WPF hyperlinks only work in pages?

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.

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

Upvotes: 10

Views: 1551

Answers (1)

SLaks
SLaks

Reputation: 887797

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).

Upvotes: 13

Related Questions