I have a folder in my project called "Guides" and have added "My Admin Guide.pdf".
The relevant xaml:
<TextBlock Margin="20,20,0,0" TextWrapping="Wrap">
<Hyperlink x:Name="Documentation_Hyperlink" NavigateUri="/Guides/My Admin Guide.pdf" TargetName="_blank" RequestNavigate="Documentation_Hyperlink_RequestNavigate">
Click Here for the Admin Guide
</Hyperlink>
</TextBlock>
In the code-behind:
private void DDI_Documentation_Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(e.Uri.ToString());
}
When I test, I get an exception "the system cannot find the file specified". I've verified e.Uri.ToString() has a value of /Guides/My Admin Guide.pdf. How do I do this properly?
ProcessStartInfo
and setWorkingDirectory
to your executable's directory. – Dour High Arch Jul 5 '20 at 23:39