TryGetFileFromPathAsync Method
Attempts to read file from the file-system by its path.
Definition
Namespace: Avalonia.Platform.Storage
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
Task<IStorageFile?> TryGetFileFromPathAsync(
Uri filePath
)
Function TryGetFileFromPathAsync (
filePath As Uri
) As Task(Of IStorageFile)
abstract TryGetFileFromPathAsync :
filePath : Uri -> Task<IStorageFile>
Parameters
- Uri
- The path of the item to retrieve in Uri format.
Return Value
Task(IStorageFile)
File or null if it doesn't exist.
Remarks
Uri path is usually expected to be an absolute path with "file" scheme. But it can be an uri with "content" scheme on the Android. It also might ask user for the permission, and throw an exception if it was denied.
See Also
Reference
IStorageProvider Interface
Avalonia.Platform.Storage Namespace