TryGetLocalPath Method
Gets the local file system path of the item as a string.
Definition
Namespace: Avalonia.Platform.Storage
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static string? TryGetLocalPath(
this IStorageItem item
)
<ExtensionAttribute>
Public Shared Function TryGetLocalPath (
item As IStorageItem
) As String
[<ExtensionAttribute>]
static member TryGetLocalPath :
item : IStorageItem -> string
Parameters
- IStorageItem
- Storage folder or file.
Return Value
String
Full local path to the folder or file if possible, otherwise null.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IStorageItem. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Android platform usually uses "content:" virtual file paths and Browser platform has isolated access without full paths, so on these platforms this method will return null.
See Also
Reference
StorageProviderExtensions Class
Avalonia.Platform.Storage Namespace