diff --git a/StabilityMatrix.Avalonia/Helpers/IOCommands.cs b/StabilityMatrix.Avalonia/Helpers/IOCommands.cs new file mode 100644 index 00000000..d60c7725 --- /dev/null +++ b/StabilityMatrix.Avalonia/Helpers/IOCommands.cs @@ -0,0 +1,19 @@ +using CommunityToolkit.Mvvm.Input; +using StabilityMatrix.Core.Processes; + +namespace StabilityMatrix.Avalonia.Helpers; + +public static class IOCommands +{ + public static RelayCommand OpenUrlCommand { get; } = + new( + url => + { + if (string.IsNullOrWhiteSpace(url)) + return; + + ProcessRunner.OpenUrl(url); + }, + url => !string.IsNullOrWhiteSpace(url) + ); +}