Fix downloadFile

This commit is contained in:
2025-12-30 17:40:08 +01:00
parent 37d66c90d2
commit ce86cba86c
17 changed files with 168 additions and 47 deletions

View File

@@ -0,0 +1,24 @@
using QuickLook;
using salesbook.Maui.Core.Interface;
using salesbook.Maui.Helpers;
using UIKit;
namespace salesbook.Maui.Core;
public class FilePreviewService : IFilePreviewService
{
public Task Preview(string fileName, string filePath)
{
var currentController = UIApplication.SharedApplication.KeyWindow?.RootViewController;
while (currentController?.PresentedViewController != null)
currentController = currentController.PresentedViewController;
var currentView = currentController?.View;
var qLPreview = new QLPreviewController();
var item = new QlPreviewItemBundle(fileName, filePath);
qLPreview.DataSource = new PreviewControllerDs(item);
currentController?.PresentViewController(qLPreview, true, null);
return Task.CompletedTask;
}
}