.NET Framework Class Library for Silverlight
HyperlinkButton..::.TargetName Property

Gets or sets the name of the target window or frame that the Web page should open in, or the name of the object within the Silverlight application to navigate to.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
Syntax

Visual Basic (Declaration)
Public Property TargetName As String
    Get
    Set
Visual Basic (Usage)
Dim instance As HyperlinkButton
Dim value As String

value = instance.TargetName

instance.TargetName = value
C#
public string TargetName { get; set; }
XAML Attribute Usage
<object TargetName="string"/>

Property Value

Type: System..::.String
Gets or sets the name of the target window or frame that the Web page should open in, or the name of the object within the Silverlight application to navigate to.
Remarks

Dependency property identifier field: TargetNameProperty

When navigating to a location external to the current Silverlight application, the TargetName property corresponds to a standard HTML TARGET attribute. You can specify where the new content will be displayed when the user clicks the HyperlinkButton. The following table lists some target names and describes the results when they are used in the HyperlinkButton control.

Target

Description

_blank, _media, or _search

Loads the linked document into a new blank window.

_parent, _self, _top, or ""

Loads the page into the window in which the link was clicked (the active window).

When navigating to a location internal to the current Silverlight application, the TargetName should correspond to a x:Name Attribute for an object in the visual tree, which also implements the INavigate interface. The HyperlinkButton attempts to locate the target object. If an INavigate object with the TargetName is successfully located, the HyperlinkButton calls Navigate on the object, passing the NavigateUri as the URI parameter to that method. 

Examples

The following code example demonstrates a HyperlinkButton. This code will open an external Web page in a new blank window.

XAML
<HyperlinkButton Content="Click here to learn about Silverlight"
    NavigateUri="http://www.silverlight.net" TargetName="_blank" Margin="10,60,0,0"/>
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Other Resources

Tags :


Page view tracker