Files
Walleby/Wallet/HyperlinkHandler.cs
T
2024-06-10 20:28:22 +01:00

26 lines
570 B
C#

using System.Diagnostics;
using Toolkit.Foundation;
namespace Wallet;
public class HyperlinkHandler :
INotificationHandler<CreateEventArgs<Hyperlink>>
{
public Task Handle(CreateEventArgs<Hyperlink> args)
{
if (args.Sender is Hyperlink hyperlink && hyperlink.Value is { Length: > 0 } value)
{
try
{
Process.Start(new ProcessStartInfo { FileName = value, UseShellExecute = true });
}
catch
{
}
}
return Task.CompletedTask;
}
}