New attachment templates that support saving and opening attachment when composing message.
This commit is contained in:
16
Wino.Core.UWP/Extensions/StorageFileExtensions.cs
Normal file
16
Wino.Core.UWP/Extensions/StorageFileExtensions.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Toolkit.Uwp.Helpers;
|
||||
using Wino.Core.Domain.Models.Common;
|
||||
|
||||
namespace Wino.Core.UWP.Extensions
|
||||
{
|
||||
public static class StorageFileExtensions
|
||||
{
|
||||
public static async Task<SharedFile> ToSharedFileAsync(this Windows.Storage.StorageFile storageFile)
|
||||
{
|
||||
var content = await storageFile.ReadBytesAsync();
|
||||
|
||||
return new SharedFile(storageFile.Path, content);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user