It can be achieved like this:
XAML:
<TextBlock>
<Hyperlink RequestNavigate="HandleLinkClick" NavigateUri="{Binding Path=Url}">
<TextBlock Text="{Binding Path=LinkTitle}"/>
</Hyperlink>
</TextBlock>
And the C#:
private void HandleLinkClick(object sender, RoutedEventArgs e) {
Hyperlink hl = (Hyperlink)sender;
string navigateUri = hl.NavigateUri.ToString();
Process.Start(new ProcessStartInfo(navigateUri));
e.Handled = true;
}
No comments:
Post a Comment