Reputation:
is there a way to retrieve/catch a link URI in xps document that opened in a wpf application document viewer? I'm using a document viewer control to open xps file:
<Grid>
<DocumentViewer x:Name="docview" HorizontalAlignment="Left" VerticalAlignment="Top">
<FixedDocument/>
</DocumentViewer>
</Grid>
then there is a link in the Opened Document like the blue underlined text in picture:
picture of viewer and opened document
I like the event of clicking the link begin handheld by my custom event handler.
Upvotes: 1
Views: 225
Reputation: 172
What about:
<Grid>
<Grid.Resources>
<Style TargetType="Hyperlink">
<Style.Setters>
<EventSetter Event="Click" Handler="OnClickHyperlinkElement" />
</Style.Setters>
</Style>
</Grid.Resources>
<DocumentViewer x:Name="docview" HorizontalAlignment="Left" VerticalAlignment="Top">
<FixedDocument/>
</DocumentViewer>
</Grid>
Upvotes: 1