Skip to main content

IStorageItem Interface

Definition

Assembly:Avalonia.Base
Package:Avalonia

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

public interface IStorageItem

Implements: IDisposable

Remarks

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

Methods

NameDescription
DeleteAsyncDeletes the current storage item and it's contents
GetBasicPropertiesAsyncGets the basic properties of the current item.
GetParentAsyncGets the parent folder of the current storage item.
MoveAsyncMoves the current storage item and it's contents to a Avalonia.Platform.Storage.IStorageFolder
SaveBookmarkAsyncSaves items to a bookmark.

DeleteAsync Method

Deletes the current storage item and it's contents

public System.Threading.Tasks.Task DeleteAsync()

Returns

System.Threading.Tasks.Task

GetBasicPropertiesAsync Method

Gets the basic properties of the current item.

public System.Threading.Tasks.Task<Avalonia.Platform.Storage.StorageItemProperties> GetBasicPropertiesAsync()

Returns

System.Threading.Tasks.Task<Avalonia.Platform.Storage.StorageItemProperties>

GetParentAsync Method

Gets the parent folder of the current storage item.

public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder> GetParentAsync()

Returns

System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageFolder>

MoveAsync Method

Moves the current storage item and it's contents to a Avalonia.Platform.Storage.IStorageFolder

public System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageItem> MoveAsync(Avalonia.Platform.Storage.IStorageFolder destination)

Parameters

destination Avalonia.Platform.Storage.IStorageFolder

The Avalonia.Platform.Storage.IStorageFolder to move the item into

Returns

System.Threading.Tasks.Task<Avalonia.Platform.Storage.IStorageItem>

SaveBookmarkAsync Method

Saves items to a bookmark.

public System.Threading.Tasks.Task<string> SaveBookmarkAsync()

Returns

System.Threading.Tasks.Task<string>

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

Properties

NameDescription
CanBookmarkReturns true is item can be bookmarked and reused later.
NameGets the name of the item including the file name extension if there is one.
PathGets the file-system path of the item.

CanBookmark Property

Returns true is item can be bookmarked and reused later.

public bool CanBookmark { get; set; }

Name Property

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

public string Name { get; set; }

Path Property

Gets the file-system path of the item.

public Uri Path { get; set; }

Remarks

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