wpf-hyperlink-navigation

star 7

Open browser URLs from WPF views using Hyperlink and RequestNavigate

elbruno By elbruno schedule Updated 5/24/2026

name: "wpf-hyperlink-navigation" description: "Open browser URLs from WPF views using Hyperlink and RequestNavigate" domain: "wpf-ui" confidence: "medium" source: "earned"

Context

Use this when a WPF screen needs clickable URLs that open in the user's default browser.

Patterns

  • Prefer <Hyperlink NavigateUri="..."> inside a TextBlock over mouse click handlers for links.
  • Handle RequestNavigate in code-behind and call a centralized OpenUrl(string) helper.
  • Keep TextDecorations="Underline" and a link color for discoverability.

Examples

<TextBlock>
  <Hyperlink NavigateUri="{Binding HostUrl}"
             RequestNavigate="Url_RequestNavigate">
    <Run Text="{Binding HostUrl}"/>
  </Hyperlink>
</TextBlock>
private void Url_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
    OpenUrl(e.Uri.AbsoluteUri);
    e.Handled = true;
}

Anti-Patterns

  • Using MouseLeftButtonDown for links when Hyperlink works.
  • Duplicating Process.Start logic in multiple views.
  • Binding non-Visibility properties through visibility-only converters.
Install via CLI
npx skills add https://github.com/elbruno/ElBruno.AspireMonitor --skill wpf-hyperlink-navigation
Repository Details
star Stars 7
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator