Compartilhar via


IXRHyperlinkButton (Compact 2013)

3/28/2014

This C++ class represents a control that displays a hyperlink.

Syntax

class IXRHyperlinkButton : public IXRButtonBase

Inheritance Hierarchy

IXRButtonBase

     IXRHyperlinkButton

Methods

Method

Description

IXRHyperlinkButton::GetNavigateUri

Retrieves the uniform resource identifier (URI) of the web page that your custom code can open when the user clicks this hyperlink control.

IXRHyperlinkButton::GetTargetName

Retrieves the target window in which your custom code can display the web page.

IXRHyperlinkButton::SetNavigateUri

Sets the URI of the web page that you would like to open when the user clicks this hyperlink control.

IXRHyperlinkButton::SetTargetName

Sets the target window in which you would like the web page to display.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

Users can click a hyperlink control to open a web page that is referenced by a URI.

To set the hyperlink text, create a string of type XRValue, and supply the string to the inherited method IXRContentControl::SetContent.

To set the URI of the web page you would like to open, call IXRHyperlinkButton::SetNavigateUri. If the URI is an external web page, specify the target window or frame in which the page should open by calling IXRHyperlinkButton::SetTargetName.

To implement opening the web page when the hyperlink is clicked, you must write custom event-handling code for the OnClick event and add it to the hyperlink control by calling the inherited method IXRButtonBase::AddClickEventHandler.

When you create a class instance, use an IXRHyperlinkButtonPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also create a hyperlink control in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the HyperlinkButton Class on MSDN.

.NET Framework Equivalent

System.Windows.Controls.HyperlinkButton

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management