Browse Source

Add IOCommands for shared OpenUrlCommand

pull/324/head
Ionite 12 months ago
parent
commit
57303be06c
No known key found for this signature in database
  1. 19
      StabilityMatrix.Avalonia/Helpers/IOCommands.cs

19
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<string?> OpenUrlCommand { get; } =
new(
url =>
{
if (string.IsNullOrWhiteSpace(url))
return;
ProcessRunner.OpenUrl(url);
},
url => !string.IsNullOrWhiteSpace(url)
);
}
Loading…
Cancel
Save