tags:

views:

286

answers:

1

Hi all,

I'm using WPF and an Hyperlink control with

    <TextBlock Margin="98,190,116,133.418" FontSize="14">
        <Hyperlink Name="hyperlink" RequestNavigate="Hyperlink_RequestNavigate">
            Click here
        </Hyperlink>
    </TextBlock>

this is working, but I would like to set the "click here" value by code, but I'm unable to find the correct property.

hyperlink.Value ?
hyperlink.Text ?

Thanks in advance for your help

+2  A: 

Hyperlink Properties

Hyperlink.NavigateUri

Aviad P.
I use this : hyperlink.NavigateUri = new Uri(value); but nothing visible, text is empty
Tim
Check your Uri format, is it valid?
Aviad P.
yes, If i let the "click here" in the xaml, I can click on it and go to the good url with private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) { Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)); e.Handled = true; }
Tim
for example, I use : hyperlink.NavigateUri = new Uri("http:// www.google.co.in", UriKind.Absolute); (whithout the space before www, else the formating is bad)
Tim
So the problem is the display text? You should examine the `Inlines` property which contains the actual text of the hyperlink.
Aviad P.
With Inlines it's working, thanks for your help
Tim