Add "onCurrentDirectoryChanged"

This commit is contained in:
MATRIX-feather 2020-12-04 19:52:25 +08:00
parent fb080284d2
commit 7104230ae3
1 changed files with 6 additions and 4 deletions

View File

@ -126,15 +126,17 @@ private void load(Storage storage)
fileNameScroll.ScrollContent.Origin = Anchor.Centre;
currentFile.BindValueChanged(updateFileSelectionText, true);
currentDirectory.BindValueChanged(_ =>
{
currentFile.Value = null;
});
currentDirectory.BindValueChanged(onCurrentDirectoryChanged);
currentDirectory.BindTo(fileSelector.CurrentPath);
currentFile.BindTo(fileSelector.CurrentFile);
}
private void onCurrentDirectoryChanged(ValueChangedEvent<DirectoryInfo> v)
{
currentFile.Value = null;
}
private void updateFileSelectionText(ValueChangedEvent<FileInfo> v)
{
currentFileText.Text = v.NewValue?.Name ?? "Select a file";