NavigateUri property
Collapse the table of content
Expand the table of content

HyperlinkButton.NavigateUri property

Gets or sets the Uniform Resource Identifier (URI) to navigate to when the HyperlinkButton is clicked.

Syntax


Public Property NavigateUri As Uri


<HyperlinkButton NavigateUri="uriString"/>

Property value

Type: System.Uri [.NET] | Windows::Foundation::Uri [C++]

The URI to navigate to when the HyperlinkButton is clicked.

Remarks

When a user clicks or otherwise invokes a HyperlinkButton, it opens the URI you specified for the NavigateUri property in the default browser.

You don't have to use http: or https: schemes for the URI. You can use schemes such as ms-appx:, ms-appdata:, or ms-resources:, if there's resource content at these locations that's appropriate to load in a browser. However, the file: scheme is specifically blocked. For more info, see URI schemes.

HyperlinkButton is a control, so it has input events such as Tapped, and it's a ButtonBase subclass so it also has a Click event. You don't typically specify a value for NavigateUri and also handle input events that are interpreted as clicking the HyperlinkButton. The action of opening the NavigateUri in a default browser is a system action that takes place without requiring any event handling. If your intent is that the HyperlinkButton should load a specified URI within a WebView control that's also part of your app, then don't specify a value for NavigateUri. Handle the Click event instead, and call WebView.Navigate, specifying the URI to load.

Examples

Here's a HyperlinkButton as declared in XAML. It declares a string value for Content and also a NavigateUri value.


<HyperlinkButton Content="www.microsoft.com" NavigateUri="http://www.microsoft.com"/>


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

HyperlinkButton
Quickstart: Adding button controls

 

 

Show:
© 2016 Microsoft