You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
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) |
|
); |
|
|
|
public static AsyncRelayCommand<string?> OpenFileBrowserCommand { get; } = |
|
new( |
|
async path => |
|
{ |
|
if (string.IsNullOrWhiteSpace(path)) |
|
return; |
|
|
|
await ProcessRunner.OpenFileBrowser(path); |
|
}, |
|
path => !string.IsNullOrWhiteSpace(path) |
|
); |
|
|
|
public static AsyncRelayCommand<string?> OpenFolderBrowserCommand { get; } = |
|
new( |
|
async path => |
|
{ |
|
if (string.IsNullOrWhiteSpace(path)) |
|
return; |
|
|
|
await ProcessRunner.OpenFolderBrowser(path); |
|
}, |
|
path => !string.IsNullOrWhiteSpace(path) |
|
); |
|
}
|
|
|