How to pass link URI from XPS document to wpf app?

Is there a way to get / trap the URI of the link in the xps document that opens in the document viewer of the wpf app? I am using a document viewer to open the xps file:

  <Grid>
    <DocumentViewer x:Name="docview" HorizontalAlignment="Left" VerticalAlignment="Top">
        <FixedDocument/>
    </DocumentViewer>
</Grid>

      

then the opened document has a link like blue underlined text in the picture:
viewer image and open document

I like the link click event starting with my custom event handler.

+3


source to share


1 answer


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>

      

+1


source







All Articles