Hyperlink Hyperlink Hyperlink Hyperlink Class

Definition

Provides an inline-level content element that provides facilities for hosting hyperlinks.

public : sealed class Hyperlink : Span, IHyperlink, IHyperlink2, IHyperlink3, IHyperlink4, IHyperlink5
public sealed class Hyperlink : Span, IHyperlink, IHyperlink2, IHyperlink3, IHyperlink4, IHyperlink5
Public NotInheritable Class Hyperlink Inherits Span Implements IHyperlink, IHyperlink2, IHyperlink3, IHyperlink4, IHyperlink5
var hyperlink = new hyperlink();
<Hyperlink .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

Here's an example of a simple Hyperlink element in a TextBlock.

In XAML, the creation of content elements is implicit, so you can add the link text directly to the Hyperlink, and the Hyperlink directly to the TextBlock element.

In code, you have to explicitly create each Run element, set its Text property, and add it to the appropriate Inlines collection (either the Hyperlink or the TextBlock ).

<TextBlock><Hyperlink NavigateUri="http://www.bing.com">Go to Bing</Hyperlink></TextBlock>
// Create a TextBlock. The hyperlink is the TextBlock content. 
TextBlock tb = new TextBlock();

// Create a Hyperlink and a Run. 
// The Run provides the visible content of the hyperlink. 
Hyperlink hyperlink = new Hyperlink();
Run run = new Run();

// Set the Text property on the Run. This will be the visible text of the hyperlink.
run.Text = "Go to Bing";
// Set the URI for the Hyperlink. 
hyperlink.NavigateUri = new Uri("http://www.bing.com");

// Add the Run to Hyperlink.Inlines collection.
hyperlink.Inlines.Add(run);
// Add the text elements to the TextBlock.Inlines collection.
tb.Inlines.Add(hyperlink);
// Add the TextBlock to a StackPanel (defined in the XAML page).        
stackPanel.Children.Add(tb);

This example shows a Hyperlink element in a TextBlock with other text.

In XAML, the creation of content elements is implicit, so you can add the link text directly to the Hyperlink. The Span element with the xml:space="preserve" attribute is used to preserve white space around the hyperlink.

In code, you have to explicitly create each Run element, set its Text property, and add it to the appropriate Inlines collection (either the Hyperlink or the TextBlock ).

<TextBlock>
    <Span xml:space="preserve"><Run>Open </Run><Hyperlink NavigateUri="http://www.bing.com">Bing</Hyperlink><Run> in your browser.</Run></Span>
</TextBlock>
// Create a TextBlock. The hyperlink is part of the TextBlock content. 
// Set TextWrapping so that the text and the hyperlink wrap if the content is too wide.
TextBlock tb = new TextBlock();
tb.TextWrapping = TextWrapping.Wrap;

// Create a Hyperlink and a Run. 
// The Run provides the visible content of the hyperlink. 
Hyperlink hyperlink = new Hyperlink();
Run run = new Run();
// Set the Text property on the Run. This will be the visible text of the hyperlink.
run.Text = "Bing";
// Set the URI for the Hyperlink. 
hyperlink.NavigateUri = new Uri("http://www.bing.com");
//Add the Run to Hyperlink.Inlines collection.
hyperlink.Inlines.Add(run);

// Create Run elements for the text around the hyperlink.
Run run1 = new Run();
Run run2 = new Run();            
//Set the Text property on the Run elements.
run1.Text = "Open ";
run2.Text = " in your browser.";

// Add the text elements to the TextBlock.Inlines collection.
tb.Inlines.Add(run1);
tb.Inlines.Add(hyperlink);
tb.Inlines.Add(run2);

// Add the TextBlock to a StackPanel (defined in the XAML page).        
stackPanel.Children.Add(tb);

Here's an example of a simple Hyperlink element in a TextBlock.

In XAML, the creation of content elements is implicit, so you can add the link text directly to the Hyperlink, and the Hyperlink directly to the TextBlock element. The Span element with the xml:space="preserve" attribute is used to preserve white space around the hyperlink.

In code, you have to explicitly create each text element (for example, Run, Paragraph, or Italic ) and add it to the appropriate Inlines collection.

<RichTextBlock>
    <Paragraph>
        <Span xml:space="preserve">
            <Run>This shows a hyperlink in a paragraph of text. You can click it to open </Run><Hyperlink NavigateUri="http://www.bing.com" UnderlineStyle="None" FontWeight="SemiBold"><Italic>Bing</Italic></Hyperlink><Run> in your browser.</Run>
        </Span>
    </Paragraph>
</RichTextBlock>
// Create a RichTextBlock. The hyperlink is part of the content. 
// Set TextWrapping so that the text and the hyperlink wrap if the content is too wide.
RichTextBlock rtb = new RichTextBlock();
rtb.TextWrapping = TextWrapping.Wrap;

// Create a Hyperlink and a Run. 
// The Run provides the visible content of the hyperlink. 
Hyperlink hyperlink = new Hyperlink();
Run run = new Run();
// Set the Text property on the Run. This will be the visible text of the hyperlink.
run.Text = "Bing";
// Set the URI  and other properties for the Hyperlink. 
hyperlink.NavigateUri = new Uri("http://www.bing.com");
hyperlink.UnderlineStyle = UnderlineStyle.None;
hyperlink.FontWeight = Windows.UI.Text.FontWeights.SemiBold;
//Add the Run to Hyperlink.Inlines collection.
hyperlink.Inlines.Add(run);


// Create an Italic element for the hyperlink.            
Italic italic = new Italic();
italic.Inlines.Add(hyperlink);

// Create Run elements for the text around the hyperlinks.
// Set the Text property on the Run elements.
Run run1 = new Run();
Run run2 = new Run();
run1.Text = "This shows a hyperlink in a paragraph of text. You can click it to open ";
run2.Text = " in your browser.";

// Create a Paragraph to hold the RichTextBlock content.
Paragraph paragraph = new Paragraph();

// Add the text elements to the Paragraph.Inlines collection.
paragraph.Inlines.Add(run1);
paragraph.Inlines.Add(italic);
paragraph.Inlines.Add(run2);
//Add the paragraph to the RichTextBlock.
rtb.Blocks.Add(paragraph);
// Add the RichTextBlock to a StackPanel (defined in the XAML page).        
stackPanel.Children.Add(rtb);

Remarks

There are two ways that you can add a hyperlink to a XAML app. Hyperlink and HyperlinkButton have the similar purpose of enabling a user to launch a specific URI using a separate browser app.+ Use an inline Hyperlink text element inside of a text control. A Hyperlink element flows with other text elements and you can use it in any InlineCollection.

You use the Hyperlink element to add interactive text to the content of a TextBlock or RichTextBlock. Hyperlink is derived from the Inline class, so you can place it inside of any container that has an InlineCollection as its Inlines property, such as TextBlock, Paragraph, or Span.

Tip

When you use a Hyperlink within a Span container with other text elements in XAML, apply the xml:space="preserve" attribute to the Span to keep the white space between the Hyperlink and other elements.

To use the hyperlink to navigate to a Uniform Resource Identifier (URI), set the NavigateUri property. When a user clicks or taps the Hyperlink element, the specified Uniform Resource Identifier (URI) opens in the default browser. The default browser runs in a separate process from your app.

Tip

You don't have to use http: or https: schemes. 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.

When a user clicks the Hyperlink, the value of the NavigateUri property is passed to a system handler for Uniform Resource Identifier (URI) types and schemes. The system then launches the app that is registered for the scheme of the Uniform Resource Identifier (URI) provided for NavigateUri.

If you don't want the Hyperlink to load content in a default Web browser (and don't want a browser to appear), then don't set a value for NavigateUri. Instead, handle the Click event, and write code that does what you want.

Handle the Click event

Use the Click event for actions other than launching a Uniform Resource Identifier (URI) in a browser, such as navigation within the app. For example, if you want to load a new app page rather than opening a browser, call a Frame.Navigate method within your Click event handler to navigate to the new app page. If you want an external, absolute Uniform Resource Identifier (URI) to load within a WebView control that also exists in your app, call WebView.Navigate as part of your Click handler logic.

You don't typically handle the Click event as well as specifying a NavigateUri value, as these represent two different ways of using the Hyperlink element. If your intent is to open the URI in the default browser, and you have specified a value for NavigateUri, don't handle the Click event. Conversely, if you handle the Click event, don't specify a NavigateUri.

There's nothing you can do within the Click event handler to prevent the default browser from loading any valid target specified for NavigateUri; that action takes place automatically (asynchronously) when the hyperlink is activated and can't be canceled from within the Click event handler.

Because a Hyperlink is not a UIElement, it does not have the set of UI element input events such as Tapped, PointerPressed and so on. Instead, a Hyperlink has its own Click event, plus the implicit behavior of the system loading any Uniform Resource Identifier (URI) specified as the NavigateUri. The system handles all input actions that should invoke the Hyperlink actions and raises the Click event in response.

Hyperlink has restrictions on the content that can exist in its Inlines collection. Specifically, a Hyperlink only permits Run and other Span types that aren't another Hyperlink. InlineUIContainer can't be in the Inlines collection of a Hyperlink. Attempting to add restricted content throws an invalid argument exception or XAML parse exception.

Hyperlink doesn't inherit from Control, so it doesn't have a Style property or a Template. You can edit the properties that are inherited from TextElement, such as Foreground or FontFamily, to change the appearance of a Hyperlink, but you can't use a common style or template to apply changes. Instead of using a template, consider using common resources for values of Hyperlink properties to provide consistency. Some properties of Hyperlink use defaults from a {ThemeResource} markup extension value provided by the system. This enables the Hyperlink appearance to switch in appropriate ways when the user changes the system theme at run-time.

The default color of the hyperlink is the accent color of the system. You can set the Foreground property to override this.

By default, Hyperlink is underlined. This underline is important because it helps meet accessibility requirements. Color-blind users use the underline to distinguish between hyperlinks and other text. You can set the UnderlineStyle property to disable the underline. If you disable underlines, you should consider adding some other type of formatting difference to distinguish hyperlinks from other text, such as FontWeight or FontStyle.

Constructors

Hyperlink() Hyperlink() Hyperlink() Hyperlink()

Initializes a new instance of the Hyperlink class.

public : Hyperlink()
public Hyperlink()
Public Sub New()
var hyperlink = new hyperlink();

Properties

ElementSoundMode ElementSoundMode ElementSoundMode ElementSoundMode

Gets or sets a value that specifies the control's preference for whether it plays sounds.

public : ElementSoundMode ElementSoundMode { get; set; }
public ElementSoundMode ElementSoundMode { get; set; }
Public ReadWrite Property ElementSoundMode As ElementSoundMode
var elementSoundMode = hyperlink.elementSoundMode;
hyperlink.elementSoundMode = elementSoundMode;
Value
ElementSoundMode ElementSoundMode ElementSoundMode ElementSoundMode

An enumeration value that specifies the control's preference for whether it plays sounds. The default is Default.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

For more info, see Sound in UWP apps.

See Also

ElementSoundModeProperty ElementSoundModeProperty ElementSoundModeProperty ElementSoundModeProperty

Identifies the ElementSoundMode dependency property.

public : static DependencyProperty ElementSoundModeProperty { get; }
public static DependencyProperty ElementSoundModeProperty { get; }
Public Static ReadOnly Property ElementSoundModeProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.elementSoundModeProperty;
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

FocusState FocusState FocusState FocusState

Gets a value that specifies whether this hyperlink has focus, and the mode by which focus was obtained.

public : FocusState FocusState { get; }
public FocusState FocusState { get; }
Public ReadOnly Property FocusState As FocusState
var focusState = hyperlink.focusState;
Value
FocusState FocusState FocusState FocusState

A value of the enumeration. A value of Unfocused indicates that the hyperlink does not have focus.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

For more info, see Control.FocusState.

FocusStateProperty FocusStateProperty FocusStateProperty FocusStateProperty

Identifies the FocusState dependency property.

public : static DependencyProperty FocusStateProperty { get; }
public static DependencyProperty FocusStateProperty { get; }
Public Static ReadOnly Property FocusStateProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.focusStateProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the FocusState dependency property.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

IsTabStop IsTabStop IsTabStop IsTabStop

Gets or sets a value that indicates whether the hyperlink is included in tab navigation.

public : Platform::Boolean IsTabStop { get; set; }
public bool IsTabStop { get; set; }
Public ReadWrite Property IsTabStop As bool
var bool = hyperlink.isTabStop;
hyperlink.isTabStop = bool;
Value
Platform::Boolean bool bool bool

true if the control is included in tab navigation; otherwise, false. The default is true.

For more info, see Control.IsTabStop.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

IsTabStopProperty IsTabStopProperty IsTabStopProperty IsTabStopProperty

Identifies the IsTabStop dependency property.

public : static DependencyProperty IsTabStopProperty { get; }
public static DependencyProperty IsTabStopProperty { get; }
Public Static ReadOnly Property IsTabStopProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.isTabStopProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsTabStop dependency property.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

NavigateUri NavigateUri NavigateUri NavigateUri

Gets or sets the Uniform Resource Identifier (URI) to navigate to when the Hyperlink is activated.

public : Uri NavigateUri { get; set; }
public Uri NavigateUri { get; set; }
Public ReadWrite Property NavigateUri As Uri
var uri = hyperlink.navigateUri;
hyperlink.navigateUri = uri;
<Hyperlink NavigateUri="uriString"/>
Value
Uri Uri Uri Uri

The Uniform Resource Identifier (URI) to navigate to when the Hyperlink is activated. The default is null.

Remarks

By default, a Hyperlink appears as a text hyperlink. When a user clicks it, it opens the URI you specify in the NavigateUri property in the default browser. (More specifically, it launches in the app that's registered for the particular scheme/protocol as you specified in the NavigateUri value.) The default browser is a separate process from your app. The typical user experience is that a new browser app appears as a split pane alongside your app, and the browser gets focus.

You don't need to handle the Click event to cause the navigation when you specify a value for NavigateUri. The Click event is intended for navigation within the app, for example if you want a new app page to load, and for that scenario you don't need a NavigateUri value. There's also nothing you can do within the Click event handler to prevent the default browser from loading any valid target specified for NavigateUri; that action takes place automatically (asynchronously) when the hyperlink is activated and can't be canceled from within the Click event handler.

If your intent is that the Hyperlink 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.

You don't have to use http: or https: schemes. 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.

See Also

NavigateUriProperty NavigateUriProperty NavigateUriProperty NavigateUriProperty

Identifies the NavigateUri dependency property.

public : static DependencyProperty NavigateUriProperty { get; }
public static DependencyProperty NavigateUriProperty { get; }
Public Static ReadOnly Property NavigateUriProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.navigateUriProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the NavigateUri dependency property.

TabIndex TabIndex TabIndex TabIndex

Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by pressing the Tab key.

public : int TabIndex { get; set; }
public int TabIndex { get; set; }
Public ReadWrite Property TabIndex As int
var int = hyperlink.tabIndex;
hyperlink.tabIndex = int;
Value
int int int int

A value that determines the order of logical navigation for a device. The default value is MaxValue.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Examples

Control.Tabindex

Remarks

For more info, see Control.Tabindex.

TabIndexProperty TabIndexProperty TabIndexProperty TabIndexProperty

Identifies the TabIndex dependency property.

public : static DependencyProperty TabIndexProperty { get; }
public static DependencyProperty TabIndexProperty { get; }
Public Static ReadOnly Property TabIndexProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.tabIndexProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the TabIndex dependency property.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

UnderlineStyle UnderlineStyle UnderlineStyle UnderlineStyle

Gets or sets a value that indicates what kind of underline is shown under the hyperlink.

public : UnderlineStyle UnderlineStyle { get; set; }
public UnderlineStyle UnderlineStyle { get; set; }
Public ReadWrite Property UnderlineStyle As UnderlineStyle
var underlineStyle = hyperlink.underlineStyle;
hyperlink.underlineStyle = underlineStyle;
Value
UnderlineStyle UnderlineStyle UnderlineStyle UnderlineStyle

An enumeration value that specifies what kind of underline is shown. The default is Single.

Remarks

By default, Hyperlink elements are underlined with a single, solid line. To turn off the underline, set this property to None.

UnderlineStyleProperty UnderlineStyleProperty UnderlineStyleProperty UnderlineStyleProperty

Identifies the UnderlineStyle dependency property.

public : static DependencyProperty UnderlineStyleProperty { get; }
public static DependencyProperty UnderlineStyleProperty { get; }
Public Static ReadOnly Property UnderlineStyleProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.underlineStyleProperty;

XYFocusDown XYFocusDown XYFocusDown XYFocusDown

Gets or sets the object that gets focus when a user presses the Directional Pad (DPAD) down.

public : DependencyObject XYFocusDown { get; set; }
public DependencyObject XYFocusDown { get; set; }
Public ReadWrite Property XYFocusDown As DependencyObject
var dependencyObject = hyperlink.xyFocusDown;
hyperlink.xyFocusDown = dependencyObject;
Value
DependencyObject DependencyObject DependencyObject DependencyObject

The object that gets focus when a user presses the Directional Pad (DPAD).

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This property is supported only on the Xbox device family, and only when using a game pad or remote control. The property is ignored otherwise.

XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of a down navigation.

public : XYFocusNavigationStrategy XYFocusDownNavigationStrategy { get; set; }
public XYFocusNavigationStrategy XYFocusDownNavigationStrategy { get; set; }
Public ReadWrite Property XYFocusDownNavigationStrategy As XYFocusNavigationStrategy
var xyFocusNavigationStrategy = hyperlink.xyFocusDownNavigationStrategy;
hyperlink.xyFocusDownNavigationStrategy = xyFocusNavigationStrategy;
<Hyperlink XYFocusDownNavigationStrategy="xyFocusNavigationStrategyMemberName"/>
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

When this property is set to Auto, the strategy is inherited from the elements ancestors. If all ancestors have a value of Auto, the fallback strategy is Projection.

See Also

XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty

Identifies the XYFocusDownNavigationStrategy dependency property.

public : static DependencyProperty XYFocusDownNavigationStrategyProperty { get; }
public static DependencyProperty XYFocusDownNavigationStrategyProperty { get; }
Public Static ReadOnly Property XYFocusDownNavigationStrategyProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusDownNavigationStrategyProperty;
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

XYFocusDownProperty XYFocusDownProperty XYFocusDownProperty XYFocusDownProperty

Identifies the XYFocusDown dependency property.

public : static DependencyProperty XYFocusDownProperty { get; }
public static DependencyProperty XYFocusDownProperty { get; }
Public Static ReadOnly Property XYFocusDownProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusDownProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the XYFocusDown dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

XYFocusLeft XYFocusLeft XYFocusLeft XYFocusLeft

Gets or sets the object that gets focus when a user presses the Directional Pad (DPAD) left.

public : DependencyObject XYFocusLeft { get; set; }
public DependencyObject XYFocusLeft { get; set; }
Public ReadWrite Property XYFocusLeft As DependencyObject
var dependencyObject = hyperlink.xyFocusLeft;
hyperlink.xyFocusLeft = dependencyObject;
Value
DependencyObject DependencyObject DependencyObject DependencyObject

The object that gets focus when a user presses the Directional Pad (DPAD).

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This property is supported only on the Xbox device family, and only when using a game pad or remote control. The property is ignored otherwise.

XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of a left navigation.

public : XYFocusNavigationStrategy XYFocusLeftNavigationStrategy { get; set; }
public XYFocusNavigationStrategy XYFocusLeftNavigationStrategy { get; set; }
Public ReadWrite Property XYFocusLeftNavigationStrategy As XYFocusNavigationStrategy
var xyFocusNavigationStrategy = hyperlink.xyFocusLeftNavigationStrategy;
hyperlink.xyFocusLeftNavigationStrategy = xyFocusNavigationStrategy;
<Hyperlink XYFocusLeftNavigationStrategy="xyFocusNavigationStrategyMemberName"/>
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

When this property is set to Auto, the strategy is inherited from the elements ancestors. If all ancestors have a value of Auto, the fallback strategy is Projection.

See Also

XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty

Identifies the XYFocusLeftNavigationStrategy dependency property.

public : static DependencyProperty XYFocusLeftNavigationStrategyProperty { get; }
public static DependencyProperty XYFocusLeftNavigationStrategyProperty { get; }
Public Static ReadOnly Property XYFocusLeftNavigationStrategyProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusLeftNavigationStrategyProperty;
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

XYFocusLeftProperty XYFocusLeftProperty XYFocusLeftProperty XYFocusLeftProperty

Identifies the XYFocusLeft dependency property.

public : static DependencyProperty XYFocusLeftProperty { get; }
public static DependencyProperty XYFocusLeftProperty { get; }
Public Static ReadOnly Property XYFocusLeftProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusLeftProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the XYFocusLeft dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

XYFocusRight XYFocusRight XYFocusRight XYFocusRight

Gets or sets the object that gets focus when a user presses the Directional Pad (DPAD) right.

public : DependencyObject XYFocusRight { get; set; }
public DependencyObject XYFocusRight { get; set; }
Public ReadWrite Property XYFocusRight As DependencyObject
var dependencyObject = hyperlink.xyFocusRight;
hyperlink.xyFocusRight = dependencyObject;
Value
DependencyObject DependencyObject DependencyObject DependencyObject

The object that gets focus when a user presses the Directional Pad (DPAD).

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This property is supported only on the Xbox device family, and only when using a game pad or remote control. The property is ignored otherwise.

XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of a right navigation.

public : XYFocusNavigationStrategy XYFocusRightNavigationStrategy { get; set; }
public XYFocusNavigationStrategy XYFocusRightNavigationStrategy { get; set; }
Public ReadWrite Property XYFocusRightNavigationStrategy As XYFocusNavigationStrategy
var xyFocusNavigationStrategy = hyperlink.xyFocusRightNavigationStrategy;
hyperlink.xyFocusRightNavigationStrategy = xyFocusNavigationStrategy;
<Hyperlink XYFocusRightNavigationStrategy="xyFocusNavigationStrategyMemberName"/>
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

When this property is set to Auto, the strategy is inherited from the elements ancestors. If all ancestors have a value of Auto, the fallback strategy is Projection.

See Also

XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty

Identifies the XYFocusRightNavigationStrategy dependency property.

public : static DependencyProperty XYFocusRightNavigationStrategyProperty { get; }
public static DependencyProperty XYFocusRightNavigationStrategyProperty { get; }
Public Static ReadOnly Property XYFocusRightNavigationStrategyProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusRightNavigationStrategyProperty;
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

XYFocusRightProperty XYFocusRightProperty XYFocusRightProperty XYFocusRightProperty

Identifies the XYFocusRight dependency property.

public : static DependencyProperty XYFocusRightProperty { get; }
public static DependencyProperty XYFocusRightProperty { get; }
Public Static ReadOnly Property XYFocusRightProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusRightProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the XYFocusRight dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

XYFocusUp XYFocusUp XYFocusUp XYFocusUp

Gets or sets the object that gets focus when a user presses the Directional Pad (DPAD) up.

public : DependencyObject XYFocusUp { get; set; }
public DependencyObject XYFocusUp { get; set; }
Public ReadWrite Property XYFocusUp As DependencyObject
var dependencyObject = hyperlink.xyFocusUp;
hyperlink.xyFocusUp = dependencyObject;
Value
DependencyObject DependencyObject DependencyObject DependencyObject

The object that gets focus when a user presses the Directional Pad (DPAD).

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This property is supported only on the Xbox device family, and only when using a game pad or remote control. The property is ignored otherwise.

XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy

Gets or sets a value that specifies the strategy used to determine the target element of an up navigation.

public : XYFocusNavigationStrategy XYFocusUpNavigationStrategy { get; set; }
public XYFocusNavigationStrategy XYFocusUpNavigationStrategy { get; set; }
Public ReadWrite Property XYFocusUpNavigationStrategy As XYFocusNavigationStrategy
var xyFocusNavigationStrategy = hyperlink.xyFocusUpNavigationStrategy;
hyperlink.xyFocusUpNavigationStrategy = xyFocusNavigationStrategy;
<Hyperlink XYFocusUpNavigationStrategy="xyFocusNavigationStrategyMemberName"/>
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

When this property is set to Auto, the strategy is inherited from the elements ancestors. If all ancestors have a value of Auto, the fallback strategy is Projection.

See Also

XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty

Identifies the XYFocusUpNavigationStrategy dependency property.

public : static DependencyProperty XYFocusUpNavigationStrategyProperty { get; }
public static DependencyProperty XYFocusUpNavigationStrategyProperty { get; }
Public Static ReadOnly Property XYFocusUpNavigationStrategyProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusUpNavigationStrategyProperty;
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

XYFocusUpProperty XYFocusUpProperty XYFocusUpProperty XYFocusUpProperty

Identifies the XYFocusUp dependency property.

public : static DependencyProperty XYFocusUpProperty { get; }
public static DependencyProperty XYFocusUpProperty { get; }
Public Static ReadOnly Property XYFocusUpProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Documents.Hyperlink.xyFocusUpProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the XYFocusUp dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

AccessKey AccessKey AccessKey AccessKey

Inherited from TextElement

AccessKeyProperty AccessKeyProperty AccessKeyProperty AccessKeyProperty

Inherited from TextElement

AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner

Inherited from TextElement

AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty

Inherited from TextElement

AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction

Inherited from TextElement

AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty

Inherited from TextElement

CharacterSpacing CharacterSpacing CharacterSpacing CharacterSpacing

Inherited from TextElement

CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty

Inherited from TextElement

ContentEnd ContentEnd ContentEnd ContentEnd

Inherited from TextElement

ContentStart ContentStart ContentStart ContentStart

Inherited from TextElement

Dispatcher Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

ElementEnd ElementEnd ElementEnd ElementEnd

Inherited from TextElement

ElementStart ElementStart ElementStart ElementStart

Inherited from TextElement

ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked

Inherited from TextElement

ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty

Inherited from TextElement

FontFamily FontFamily FontFamily FontFamily

Inherited from TextElement

FontFamilyProperty FontFamilyProperty FontFamilyProperty FontFamilyProperty

Inherited from TextElement

FontSize FontSize FontSize FontSize

Inherited from TextElement

FontSizeProperty FontSizeProperty FontSizeProperty FontSizeProperty

Inherited from TextElement

FontStretch FontStretch FontStretch FontStretch

Inherited from TextElement

FontStretchProperty FontStretchProperty FontStretchProperty FontStretchProperty

Inherited from TextElement

FontStyle FontStyle FontStyle FontStyle

Inherited from TextElement

FontStyleProperty FontStyleProperty FontStyleProperty FontStyleProperty

Inherited from TextElement

FontWeight FontWeight FontWeight FontWeight

Inherited from TextElement

FontWeightProperty FontWeightProperty FontWeightProperty FontWeightProperty

Inherited from TextElement

Foreground Foreground Foreground Foreground

Inherited from TextElement

ForegroundProperty ForegroundProperty ForegroundProperty ForegroundProperty

Inherited from TextElement

Inlines Inlines Inlines Inlines

Inherited from Span

IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope

Inherited from TextElement

IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty

Inherited from TextElement

IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled

Inherited from TextElement

IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty

Inherited from TextElement

KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset

Inherited from TextElement

KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty

Inherited from TextElement

KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode

Inherited from TextElement

KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty

Inherited from TextElement

KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset

Inherited from TextElement

KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty

Inherited from TextElement

Language Language Language Language

Inherited from TextElement

LanguageProperty LanguageProperty LanguageProperty LanguageProperty

Inherited from TextElement

Name Name Name Name

Inherited from TextElement

TextDecorations TextDecorations TextDecorations TextDecorations

Inherited from TextElement

TextDecorationsProperty TextDecorationsProperty TextDecorationsProperty TextDecorationsProperty

Inherited from TextElement

Methods

Focus(FocusState) Focus(FocusState) Focus(FocusState) Focus(FocusState)

Attempts to set the focus on the hyperlink.

public : Platform::Boolean Focus(FocusState value)
public bool Focus(FocusState value)
Public Function Focus(value As FocusState) As bool
var bool = hyperlink.focus(value);
Parameters
value
FocusState FocusState FocusState FocusState

Specifies how focus was set, as a value of the enumeration.

Returns
Platform::Boolean bool bool bool

true if focus was set to the hyperlink, or focus was already on the hyperlink. false if the hyperlink is not focusable.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

For more info, see Control.Focus.

See Also

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

FindName(String) FindName(String) FindName(String) FindName(String)

Inherited from TextElement

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren

Inherited from TextElement

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

Events

Click Click Click Click

Occurs when the Hyperlink is clicked.

public : event TypedEventHandler Click<Hyperlink,  HyperlinkClickEventArgs>
public event TypedEventHandler Click<Hyperlink,  HyperlinkClickEventArgs>
Public Event TypedEventHandler Click( Of ( Of Hyperlink ), ( Of  HyperlinkClickEventArgs ))
function onClick(eventArgs){/* Your code */}


hyperlink.addEventListener("click", onClick);
hyperlink.removeEventListener("click", onClick);
<Hyperlink Click="eventhandler"/>

Remarks

The Click event is intended for navigation within the app, or actions other than launching a URI in a browser. For example, if you want a new app page to load rather than opening a browser, or if you want to load the URI specifically within a WebView control, you handle the Click event and write code to perform the actions you want. You don't typically handle Click as well as specifying a NavigateUri value, these represent two different ways of using the Hyperlink element. If your intent is to open the URI in the default browser, and you have specified a value for NavigateUri, don't handle Click. Conversely, if you have code for the Click event, don't specify a NavigateUri.

See Also

GotFocus GotFocus GotFocus GotFocus

Occurs when a Hyperlink receives focus.

public : event RoutedEventHandler GotFocus<>
public event RoutedEventHandler GotFocus<>
Public Event RoutedEventHandler GotFocus( Of )
function onGotFocus(eventArgs){/* Your code */}


hyperlink.addEventListener("gotFocus", onGotFocus);
hyperlink.removeEventListener("gotFocus", onGotFocus);
<Hyperlink GotFocus="eventhandler"/>
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

For more info, see UIElement.GotFocus

See Also

LostFocus LostFocus LostFocus LostFocus

Occurs when a Hyperlink loses focus.

public : event RoutedEventHandler LostFocus<>
public event RoutedEventHandler LostFocus<>
Public Event RoutedEventHandler LostFocus( Of )
function onLostFocus(eventArgs){/* Your code */}


hyperlink.addEventListener("lostFocus", onLostFocus);
hyperlink.removeEventListener("lostFocus", onLostFocus);
<Hyperlink LostFocus="eventhandler"/>
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

For more info, see UIElement.LostFocus

See Also

AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed

Inherited from TextElement

AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested

Inherited from TextElement

AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked

Inherited from TextElement

See Also