Using Hyperlink Apllication WPF in VB.NET

This article shows you how to use or create Hyperlink in WPF Application.
  • 2065
This tutorial shows you how to create Hyperlink in Windows Presentation Foundation (WPF) Application. If we are placing the Hyperlink within a page then only the NavigateUri works. We have to handle the RequestNavigate event while using it within a windows-based application and write the code ourselves as shown below:

<Page
  x:Class="WebPageNavigation.Page1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  WindowTitle="Page1"

   <Grid>
      <TextBlock FontSize="36" TextWrapping="Wrap">
      Welcome to <Hyperlink NavigateUri="http://yahoo.com">Yahoo World</Hyperlink>
      </TextBlock>
   </Grid>
</Page>

OUTPUT

Hyperlink1.gif
 

Window open after you click on Yahoo World

Hyperlink2.gif
 

NOTE:  In case if navigation fails while using hyperlink we could also provide handler for Application.NavigationFailed event.

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.