UWP HyperlinkButton
The HyperlinkButton class represents a button control that functions as
a hyperlink. The HyperlinkButton appears as underlined text when the UWP
developers set a text as the value for the Content property by default. The
developers can put the HyperlinkButton anywhere inside the UWP app.
The NavigateUri property value is passed to a system handler for URI types and schemes when users click the HyperlinkButton. The system launches the app that is registered for the scheme of the URI provided for NavigateUri.
The UWP developers avoid loading content in a Web browser by not setting a value for NavigateUri. Instead, they have to handle the Click event. The developers can use the Click event for actions other than launching a URI in a browser.
The HyperlinkButton class’s NavigateUri property gets or sets the Uniform Resource Identifier (URI) to navigate when the HyperlinkButton is clicked. This property value is a Uri to navigate when the HyperlinkButton is clicked.
The ContentControl class’s Content property gets or sets the content of a ContentControl. This property value is an Object that contains the control's content. The default value of this property is null.
The ButtonBase class’s Click event occurs when a button control is clicked. The following UWP app development tutorial demonstrates how we can use a HyperlinkButton control.
The NavigateUri property value is passed to a system handler for URI types and schemes when users click the HyperlinkButton. The system launches the app that is registered for the scheme of the URI provided for NavigateUri.
The UWP developers avoid loading content in a Web browser by not setting a value for NavigateUri. Instead, they have to handle the Click event. The developers can use the Click event for actions other than launching a URI in a browser.
The HyperlinkButton class’s NavigateUri property gets or sets the Uniform Resource Identifier (URI) to navigate when the HyperlinkButton is clicked. This property value is a Uri to navigate when the HyperlinkButton is clicked.
The ContentControl class’s Content property gets or sets the content of a ContentControl. This property value is an Object that contains the control's content. The default value of this property is null.
The ButtonBase class’s Click event occurs when a button control is clicked. The following UWP app development tutorial demonstrates how we can use a HyperlinkButton control.
MainPage.xaml
<Page
x:Class="UniversalAppTutorials.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UniversalAppTutorials"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel
x:Name="stack_panel1"
Margin="50"
Orientation="Vertical"
Background="AliceBlue"
Padding="35"
>
<HyperlinkButton
x:Name="hyperlink_button1"
Content="ASP.NET"
NavigateUri="https://www.asp.net"
Margin="20"
/>
<HyperlinkButton
x:Name="hyperlink_button2"
NavigateUri="https://www.google.com"
Margin="20"
>
<Image Source="Assets/googlelogo_color_272x92dp.png" Width="100"/>
</HyperlinkButton>
<HyperlinkButton
x:Name="hyperlink_button3"
Content="Android"
NavigateUri="https://www.android.com"
Margin="20"
/>
</StackPanel>
</Page>