FileManager Selection
The FileManager lets the user select one or multiple files and folders in its main pane. You can also pre-select a desired item.
To get or set the selected items, use the SelectedItems parameter. It is a collection of items from the FileManager's Data.
The SelectedItems parameter supports two-way binding (@bind-SelectedItems) and one-way binding together with the SelectedItemsChanged event.
See examples of both approaches:
Two-Way Binding of the SelectedItems
You can use two-way binding when you want to track what items the user selected but you don't need to respond to the user action of selecting a file/folder.
When using two-way binding, the selected items will be automatically updated in the view-port, so you don not have to do that manually.
Use two-way binding for the
SelectedItems
One-Way Binding of the SelectedItems
You can use one-way binding of the SelectedItems in combination with handling the SelectedItemsChanged event when you need to respond to the user action of selecting a file/folder.
In this case, you need to manually update the view-model as the framework does not do that automatically when using one-way binding.
Use one-way data binding for the SelectedItems