ServerFolderPickerViewModel
Class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll
The view model of the server folder dialog (ServerFolderWindow): the open folder in the path bar, its subfolders (double click opens), Up, Drives, New folder with its name checked below the field, and Choose for the open folder once the server’s check passed (IServerFolders.CheckAsync; the reason below the path bar otherwise). Testable without Avalonia; members run on the UI thread.
public sealed class ServerFolderPickerViewModel : ValidatingViewModelInherits ValidatingViewModel
Constructors
Section titled “Constructors”ServerFolderPickerViewModel
Section titled “ServerFolderPickerViewModel”ServerFolderPickerViewModel(IServerFolders folders, string? startPath)Parameters
folders: The server’s folders (ICorePluginClientContext.ServerFolders).startPath: The folder to open first (the field’s path); null or empty: the drives.
Properties
Section titled “Properties”CanChoose
Section titled “CanChoose”bool CanChoose { get; }Choose may run: nothing loads, no editor is open, and the open folder passed the check or another path was typed.
CancelNewFolderCommand
Section titled “CancelNewFolderCommand”IRelayCommand CancelNewFolderCommand { get; }Gets an IRelayCommand instance wrapping ServerFolderPickerViewModel.CancelNewFolder.
ChooseTip
Section titled “ChooseTip”string? ChooseTip { get; }Why Choose is off (its tooltip); null when it is on.
ChosenPath
Section titled “ChosenPath”string? ChosenPath { get; private set; }The folder Choose returned (the open folder).
CreateCommand
Section titled “CreateCommand”IAsyncRelayCommand CreateCommand { get; }Gets an IAsyncRelayCommand instance wrapping ServerFolderPickerViewModel.CreateAsync.
DrivesCommand
Section titled “DrivesCommand”IAsyncRelayCommand DrivesCommand { get; }Gets an IAsyncRelayCommand instance wrapping ServerFolderPickerViewModel.DrivesAsync.
EmptyText
Section titled “EmptyText”string EmptyText { get; }The line of an empty list.
Folders
Section titled “Folders”RangeObservableCollection<ServerFolder> Folders { get; }The subfolders of the open folder (the drives at the top).
GoCommand
Section titled “GoCommand”IAsyncRelayCommand GoCommand { get; }Gets an IAsyncRelayCommand instance wrapping ServerFolderPickerViewModel.GoAsync.
IsAtRoots
Section titled “IsAtRoots”bool IsAtRoots { get; private set; }The list shows the drives / top folders.
IsCreating
Section titled “IsCreating”bool IsCreating { get; private set; }The inline New folder editor is open: its Create is the primary button, Choose turns secondary.
IsEmpty
Section titled “IsEmpty”bool IsEmpty { get; }Nothing to list (after the read).
IsLoading
Section titled “IsLoading”bool IsLoading { get; private set; }A listing is being read: the list shows the loading overlay.
IsSaving
Section titled “IsSaving”bool IsSaving { get; private set; }The new folder is being made.
bool More { get; private set; }The folder has more subfolders than the list holds.
MoreText
Section titled “MoreText”static string MoreText { get; }The line below a list that was cut off.
NewFolderCommand
Section titled “NewFolderCommand”IRelayCommand NewFolderCommand { get; }Gets an IRelayCommand instance wrapping ServerFolderPickerViewModel.NewFolder.
NewFolderName
Section titled “NewFolderName”string NewFolderName { get; set; }The name of the new folder.
OpenFolderCommand
Section titled “OpenFolderCommand”IAsyncRelayCommand<ServerFolder?> OpenFolderCommand { get; }Gets an IAsyncRelayCommand<T> instance wrapping ServerFolderPickerViewModel.OpenFolderAsync.
PathText
Section titled “PathText”string PathText { get; set; }The path bar: the open folder, or what the user typed (Enter opens it).
SelectedFolder
Section titled “SelectedFolder”ServerFolder? SelectedFolder { get; set; }The row the user clicked.
UpCommand
Section titled “UpCommand”IAsyncRelayCommand UpCommand { get; }Gets an IAsyncRelayCommand instance wrapping ServerFolderPickerViewModel.UpAsync.
Methods
Section titled “Methods”ChooseAsync
Section titled “ChooseAsync”Task<bool> ChooseAsync()Choose: a typed path is opened (and checked) first; true with ServerFolderPickerViewModel.ChosenPath when the open folder passed the server’s check, else false with the reason below the path bar.
LoadAsync
Section titled “LoadAsync”Task LoadAsync()Opens the start folder; when it cannot be listed, the drives with the reason below the path bar.
OpenAsync
Section titled “OpenAsync”Task<bool> OpenAsync(string? path)Lists path (null or empty: the drives); true when it was listed. A listing that fails keeps the one before and shows why below the path bar. A newer open cancels an older one.
Fields
Section titled “Fields”LoadingText
Section titled “LoadingText”const string LoadingText = "Reading folders"The loading text of the list.
NoDrivesText
Section titled “NoDrivesText”const string NoDrivesText = "The server shows no drives."The empty list of the drives.
NoFoldersText
Section titled “NoFoldersText”const string NoFoldersText = "No folders here. Create one with New folder."The empty list of a folder.