1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-31 07:26:09 +00:00

LauchFileAsync uwp pour le pdf

This commit is contained in:
Yan Maniez 2019-04-25 23:09:44 +02:00
parent 78427093e4
commit 69091936b6

View file

@ -1,8 +1,13 @@
using AideDeJeu.Tools;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.ApplicationModel.DataTransfer;
using Windows.Foundation;
using Windows.Storage;
using System;
[assembly: Xamarin.Forms.Dependency(typeof(AideDeJeu.UWP.Version_UWP))]
namespace AideDeJeu.UWP
@ -103,10 +108,20 @@ namespace AideDeJeu.UWP
return new FileStream(filepath, FileMode.Create);
}
//public void OpenFileExternal(string filename)
//{
//}
public async Task LaunchFileAsync(string title, string message, string filePath)
{
try
{
if (!string.IsNullOrWhiteSpace(filePath))
{
StorageFile attachment = await StorageFile.GetFileFromPathAsync(filePath);
var success = await Windows.System.Launcher.LaunchFileAsync(attachment);
}
}
finally
{
}
}
}
}