public async Task <bool> FileExistsAsync(IPortableStorageFile file) { try { return(File.Exists(file.Path)); } catch { return(false); } }
public static IStorageFile AsWinRTStorageFile(this IPortableStorageFile file) { return(file.BaseFile as IStorageFile); }
public async Task DeleteFileAsync(IPortableStorageFile file) { await file.AsWinRTStorageFile().DeleteAsync(StorageDeleteOption.PermanentDelete); }