Interface IFilePickerService

Abstracts file picker dialogs so ViewModels can open file browsers without depending on Avalonia's IStorageProvider or TopLevel.

Namespace: MOSAIC.Services
Assembly: MOSAIC.dll
Syntax
public interface IFilePickerService
Remarks

Register a single implementation (backed by TopLevel.StorageProvider) in the DI container at startup. ViewModels receive it via constructor injection.

Methods

PickFolderAsync(string, string?)

Opens a folder picker and returns the selected folder's local path.

Declaration
Task<string?> PickFolderAsync(string title, string? startIn = null)
Parameters
Type Name Description
string title

Dialog title shown to the user.

string startIn

Folder to open the picker at, or null for the default.

Returns
Type Description
Task<string>

The local folder path, or null if the user cancelled.

PickJsonFileAsync(string)

Opens a file picker filtered to JSON files and returns the selected file's local path.

Declaration
Task<string?> PickJsonFileAsync(string title)
Parameters
Type Name Description
string title

Dialog title shown to the user.

Returns
Type Description
Task<string>

The local file path, or null if the user cancelled.

Search documentation

Start typing to search the documentation.