Skip to end of metadata
Go to start of metadata

Remarks

Hyperlink element provides facilities for hosting hyperlinks within FlowDocument content. You can specify NavigateUri property to the Uri of the hyperlink where user will be navigated to when the Hyperlink is clicked. Hyperlink navigation can only occur, however, if either the direct or indirect parent of a Hyperlink is a navigation host, including NavigationWindow, Frame, or any browser that can host XBAPs (which includes Internet Explorer 7, Microsoft Internet Explorer 6, and Firefox 2.0+).

Hyperlink is used in a similar manner to the <A> tag in HTML. Similar to HTML link, you can specify the target name where the link should be opened. You can specify _blank, _self, or the name of the navigation host as the target name.

AXML

You can specify several formatting that will be applied when the hyperlink is hovered and pressed. For more information, see Configuring Hyperlink Formatting.

Working with BackgroundMouseOver Property, BackgroundMousePress Property, ForegroundMouseOver Property, ForegroundMousePress Property, TextDecorationsMouseOver Property and TextDecorationsMousePress Property

As an inline element, you can specify formatting to Hyperlink element. By default, a Hyperlink element will have Underline text decoration, which will still be displayed when the element is hovered or pressed. You can use several properties to change the formatting when the hyperlink element is hovered and pressed. Simply use BackgroundMouseOver, BackgroundMousePress, ForegroundMouseOver, ForegroundMousePress, TextDecorationsMouseOver, and TextDecorationsMousePress properties.

XAML

Definition

public class Hyperlink : Span

Summary

The following table summarizes the members exposed in this class.

Public Constructors

Hyperlink Constructor()Initializes a new instance of the Hyperlink class.
Hyperlink Constructor(Inline)Initializes a new instance of the Hyperlink class.

Public Properties

BackgroundMouseOverGets or sets the Brush applied to the background of hyperlink element when it is hovered.
BackgroundMousePressGets or sets the Brush applied to the background of hyperlink element when it is pressed.
ForegroundMouseOverGets or sets the Brush applied to the hyperlink element when it is hovered.
ForegroundMousePressGets or sets the Brush applied to the hyperlink element when it is pressed.
NavigateUriGets or sets a URI to navigate to when the Hyperlink is activated.
TargetNameGets or sets the name of a target window or frame for the Hyperlink.
TextDecorationsMouseOverGets or sets the text decoration applied to the hyperlink element when it is hovered.
TextDecorationsMousePressGets or sets the text decoration applied to the hyperlink element when it is pressed.

Fields

BackgroundMouseOverPropertyIdentifies the BackgroundMouseOver dependency property.
BackgroundMousePressPropertyIdentifies the BackgroundMousePress dependency property.
ForegroundMouseOverPropertyIdentifies the ForegroundMouseOver dependency property.
ForegroundMousePressPropertyIdentifies the ForegroundMousePress dependency property.
NavigateUriPropertyIdentifies the NavigateUri dependency property.
TargetNamePropertyIdentifies the TargetName dependency property.
TextDecorationsMouseOverPropertyIdentifies the TextDecorationsMouseOver dependency property.
TextDecorationsMousePressPropertyIdentifies the TextDecorationsMousePress dependency property.

Public Constructors

public Hyperlink()

Initializes a new instance of the Hyperlink class.

public Hyperlink(Inline inline)

Initializes a new instance of the Hyperlink class.

Parameters

inline 

 

Public Properties

public Brush BackgroundMouseOver { get; set; }

Gets or sets the Brush applied to the background of hyperlink element when it is hovered.

public Brush BackgroundMousePress { get; set; }

Gets or sets the Brush applied to the background of hyperlink element when it is pressed.

public Brush ForegroundMouseOver { get; set; }

Gets or sets the Brush applied to the hyperlink element when it is hovered.

public Brush ForegroundMousePress { get; set; }

Gets or sets the Brush applied to the hyperlink element when it is pressed.

public Uri NavigateUri { get; set; }

Gets or sets a URI to navigate to when the Hyperlink is activated.

public string TargetName { get; set; }

Gets or sets the name of a target window or frame for the Hyperlink.

public TextDecorationCollection TextDecorationsMouseOver { get; set; }

Gets or sets the text decoration applied to the hyperlink element when it is hovered.

public TextDecorationCollection TextDecorationsMousePress { get; set; }

Gets or sets the text decoration applied to the hyperlink element when it is pressed.

Fields

public static readonly DependencyProperty BackgroundMouseOverProperty

Identifies the BackgroundMouseOver dependency property.

public static readonly DependencyProperty BackgroundMousePressProperty

Identifies the BackgroundMousePress dependency property.

public static readonly DependencyProperty ForegroundMouseOverProperty

Identifies the ForegroundMouseOver dependency property.

public static readonly DependencyProperty ForegroundMousePressProperty

Identifies the ForegroundMousePress dependency property.

public static readonly DependencyProperty NavigateUriProperty

Identifies the NavigateUri dependency property.

public static readonly DependencyProperty TargetNameProperty

Identifies the TargetName dependency property.

public static readonly DependencyProperty TextDecorationsMouseOverProperty

Identifies the TextDecorationsMouseOver dependency property.

public static readonly DependencyProperty TextDecorationsMousePressProperty

Identifies the TextDecorationsMousePress dependency property.

  • No labels