Enhance ConfirmDialog with customizable button styles and add PDF opening functionality in AccountDetail

This commit is contained in:
2026-03-31 19:21:14 +02:00
parent 68e4e1aa4b
commit c376c70fec
4 changed files with 64 additions and 2 deletions

View File

@@ -15,6 +15,36 @@ public class FileSaveService : IFileSaveService
return filePath;
}
public Task OpenFileAsync(string filePath)
{
if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath))
{
return Task.CompletedTask;
}
return Task.Run(() =>
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Process.Start(new ProcessStartInfo
{
FileName = filePath,
UseShellExecute = true
});
return;
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", filePath);
return;
}
Process.Start("xdg-open", filePath);
});
}
private static Task<string?> ShowSaveDialogAsync(string suggestedFileName)
{
return Task.Run(() =>