28 lines
695 B
C#
28 lines
695 B
C#
using System.Diagnostics;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Navigation;
|
|
|
|
namespace HashCalculator.GUI
|
|
{
|
|
/// <summary>
|
|
/// Opens <see cref="Hyperlink.NavigateUri"/> in a default system browser
|
|
/// </summary>
|
|
internal sealed class ShellLink : Hyperlink
|
|
{
|
|
public ShellLink()
|
|
{
|
|
RequestNavigate += OnRequestNavigate;
|
|
}
|
|
|
|
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
|
|
{
|
|
Process.Start(new ProcessStartInfo
|
|
{
|
|
FileName = e.Uri.AbsoluteUri,
|
|
UseShellExecute = true
|
|
});
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|