Enhance ConfirmDialog with customizable button styles and add PDF opening functionality in AccountDetail
This commit is contained in:
@@ -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(() =>
|
||||
|
||||
Reference in New Issue
Block a user