Class ConfigPicker
Provides helper methods for selecting and loading a MOSAIC JSON pipeline configuration via an Avalonia file picker.
Inherited Members
Namespace: MOSAIC.Components.Basics
Assembly: MOSAIC.dll
Syntax
public static class ConfigPicker
Remarks
This utility is intended for UI workflows. It opens the platform-native file picker (through
Avalonia.Platform.Storage.IStorageProvider) and filters for .json files.
If the user cancels the dialog or no file is selected, the method returns null.
Parsing is delegated to JsonParser.
Methods
PickAndLoadAsync(IStorageProvider, CancellationToken)
Opens a file picker to select a MOSAIC .json configuration file and parses it into a block dictionary.
Declaration
public static Task<IReadOnlyDictionary<string, JsonModel>?> PickAndLoadAsync(IStorageProvider storageProvider, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IStorageProvider | storageProvider | Avalonia storage provider used to display the platform-native file picker. |
| CancellationToken | ct | Optional cancellation token forwarded to the JSON parser. |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyDictionary<string, JsonModel>> | A read-only dictionary mapping block names to JsonModel, or null if the user cancels or no file is selected. |
Remarks
The returned dictionary keys are the canonical block names from the configuration and typically match Name after parsing.
Any parsing or I/O errors are surfaced from ParseStreamAsync(Stream, CancellationToken).
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |