ActiveReports.Silverlight Assembly > DataDynamics.ActiveReports.ViewModel Namespace > ViewerViewModel Class : HyperLinkClick Event |
'Declaration Public Event HyperLinkClick As EventHandler(Of HyperLinkClickEventArgs)
public event EventHandler<HyperLinkClickEventArgs> HyperLinkClick
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.
Property | Description |
---|---|
AllowHyperlink | Indicates whether to open the hyperlink. By default, the property is True. |
Url | Gets or sets the URL of the hyperlink. |
You can capture the HyperLinkClick event in one of the two ways as follows.
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"; } } |
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.
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