Вы можете использовать ICommand:
ViewModel.cs:
private static string _ApplicationUrl;
public static string ApplicationUrl
{
get
{
if (_ApplicationUrl == null)
{
_ApplicationUrl = Application.Current.Host.Source.GetComponents(UriComponents.Scheme | UriComponents.Host | UriComponents.Port, UriFormat.UriEscaped);
//_ApplicationUrl = HtmlPage.Document.DocumentUri.GetComponents(UriComponents.Scheme | UriComponents.Host | UriComponents.Port, UriFormat.UriEscaped);
}
return _ApplicationUrl;
}
}
private RelayCommand<string> _WebUriCommand;
public RelayCommand<string> WebUriCommand
{
get
{
if (_WebUriCommand == null)
{
_WebUriCommand = new RelayCommand<string>((p) => { HtmlPage.Window.Navigate(new Uri(ApplicationUrl + p), "_blank"); });
}
return _WebUriCommand;
}
}
View.xaml:
<HyperlinkButton Command="{Binding WebUriCommand}" CommandParameter="/Documents/MyDoc.pdf" Content="Download"/>