Merge pull request #5195 from zyhfish/task/fix-5191

Fix #5191: trigger event when folder changed.
This commit is contained in:
Shaun Walker
2025-03-25 19:46:24 -04:00
committed by GitHub

View File

@ -163,6 +163,13 @@
[Parameter]
public EventCallback<int> OnUpload { get; set; } // optional - executes a method in the calling component when a file is uploaded
[Parameter]
public EventCallback<int> OnSelectFolder { get; set; } // optional - executes a method in the calling component when a folder is selected
[Parameter]
public EventCallback<int> OnSelectFile { get; set; } // optional - executes a method in the calling component when a file is selected
[Obsolete("Use OnSelectFile instead.")]
[Parameter]
public EventCallback<int> OnSelect { get; set; } // optional - executes a method in the calling component when a file is selected
@ -300,6 +307,8 @@
FileId = -1;
_file = null;
_image = string.Empty;
await OnSelectFolder.InvokeAsync(FolderId);
StateHasChanged();
}
catch (Exception ex)
@ -316,6 +325,7 @@
FileId = int.Parse((string)e.Value);
await SetImage();
await OnSelect.InvokeAsync(FileId);
await OnSelectFile.InvokeAsync(FileId);
StateHasChanged();
}
@ -439,6 +449,7 @@
FileId = file.FileId;
await SetImage();
await OnSelect.InvokeAsync(FileId);
await OnSelectFile.InvokeAsync(FileId);
await OnUpload.InvokeAsync(FileId);
}
await GetFiles();
@ -490,6 +501,7 @@
FileId = -1;
await SetImage();
await OnSelect.InvokeAsync(FileId);
await OnSelectFile.InvokeAsync(FileId);
StateHasChanged();
}
catch (Exception ex)