Export (0) Print
Expand All

Hyperlink.NavigateUri Property

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

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[BindableAttribute(true)] 
[LocalizabilityAttribute(LocalizationCategory.Hyperlink)] 
public Uri NavigateUri { get; set; }
/** @property */
public Uri get_NavigateUri ()

/** @property */
public void set_NavigateUri (Uri value)

public function get NavigateUri () : Uri

public function set NavigateUri (value : Uri)

<object NavigateUri="Uri" .../>

Property Value

The Uri to navigate to when the Hyperlink is activated. The default value is null.

To link to a particular inline element, specify the element name preceded by a pound symbol (#).

The following example shows how to use the NavigateUri attribute of a Hyperlink element.

<Paragraph>
  <Run>Text preceding the hyperlink.</Run>
  <Hyperlink
    NavigateUri="http://search.msn.com"
  >
    Link text.
  </Hyperlink>
  <Run Name="test">Text following the hyperlink.</Run>
</Paragraph>

The following example shows how to set the NavigateUri property programmatically.

Paragraph parx = new Paragraph();
Run run1 = new Run("Text preceeding the hyperlink.");
Run run2 = new Run("Text following the hyperlink.");
Run run3 = new Run("Link Text.");

Hyperlink hyperl = new Hyperlink(run3);
hyperl.NavigateUri = new Uri("http://search.msn.com");

parx.Inlines.Add(run1);
parx.Inlines.Add(hyperl);
parx.Inlines.Add(run2);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft