Table of Contents

Interface IStorageItem

Namespace
Avalonia.Platform.Storage
Assembly
Avalonia.Base.dll

Manipulates storage items (files and folders) and their contents, and provides information about them

[NotClientImplementable]
public interface IStorageItem : IDisposable
Inherited Members
Extension Methods

Remarks

This interface inherits IDisposable . It's recommended to dispose IStorageItem when it's not used anymore.

Properties

CanBookmark

Returns true is item can be bookmarked and reused later.

bool CanBookmark { get; }

Property Value

bool

Name

Gets the name of the item including the file name extension if there is one.

string Name { get; }

Property Value

string

Path

Gets the file-system path of the item.

Uri Path { get; }

Property Value

Uri

Remarks

Android backend might return file path with "content:" scheme. Browser and iOS backends might return relative uris.

Methods

DeleteAsync()

Deletes the current storage item and it's contents

Task DeleteAsync()

Returns

Task

GetBasicPropertiesAsync()

Gets the basic properties of the current item.

Task<StorageItemProperties> GetBasicPropertiesAsync()

Returns

Task<StorageItemProperties>

GetParentAsync()

Gets the parent folder of the current storage item.

Task<IStorageFolder?> GetParentAsync()

Returns

Task<IStorageFolder>

MoveAsync(IStorageFolder)

Moves the current storage item and it's contents to a IStorageFolder

Task<IStorageItem?> MoveAsync(IStorageFolder destination)

Parameters

destination IStorageFolder

The IStorageFolder to move the item into

Returns

Task<IStorageItem>

SaveBookmarkAsync()

Saves items to a bookmark.

Task<string?> SaveBookmarkAsync()

Returns

Task<string>

Returns identifier of a bookmark. Can be null if OS denied request.