ActiveReports 6 Online Help
HyperLinkClick Event

Raised when the hyperlink is clicked.
Syntax
'Declaration
 
Public Event HyperLinkClick As EventHandler(Of HyperLinkClickEventArgs)
public event EventHandler<HyperLinkClickEventArgs> HyperLinkClick
Event Data

The event handler receives an argument of type HyperLinkClickEventArgs containing data related to this event. The following HyperLinkClickEventArgs properties provide information specific to this event.

PropertyDescription
AllowHyperlinkIndicates whether to open the hyperlink. By default, the property is True.  
Url

Gets or sets the URL of the hyperlink.

 
Remarks

You can capture the HyperLinkClick event in one of the two ways as follows.

  1. Add the following code to the viewer1_Loaded event.

    Paste to MainPage.xaml.cs to the viewer1_Loaded event

    Copy Code
    viewer1.ViewModel.HyperLinkClick += new EventHandler<DataDynamics.ActiveReports.ViewModel.HyperLinkClickEventArgs>(ViewModel_HyperLink);

    Paste to MainPage.xaml.cs below the viewer1_Loaded event

    Copy Code
    void ViewModel_HyperLink(object sender, DataDynamics.ActiveReports.ViewModel.HyperLinkClickEventArgs e)
    {
        // Get the value of Url property
        if (e.Url.Equals("ActiveReports"))
        {
            // Set Url property to a new URL
            e.Url = "http://www.datadynamics.com";
        }
    }
  2. Or, In the Visual Studio Designer, add the following code to the Design view of MainPage.xaml.

    Paste to the Design view of MainPage.xaml
    Copy Code
    <UserControl
    ...
    xmlns:vvm="clr-namespace:DataDynamics.ActiveReports.ViewModel;assembly=ActiveReports.Silverlight"
    ...>
    ...
    <Grid x:Name="LayoutRoot" Background="White">
        <my:Viewer Name="viewer1" >
            <my:Viewer.ViewModel>
                <vvm:ViewerViewModel />
            </my:Viewer.ViewModel>
        </my:Viewer>
    </Grid>
    </UserControl>

    Left-click <vvm:ViewerViewModel /> and go to the Properties window, then to the Events view to set the event.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ViewerViewModel Class
ViewerViewModel Members

Send Feedback