123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using FNZCM.BlazorWasm.Models;
- using Microsoft.AspNetCore.Components;
- using Microsoft.JSInterop;
- namespace FNZCM.BlazorWasm.UI.Views.Browse
- {
- public partial class BrowseView
- {
- [Inject]
- private IJSRuntime Js { get; set; }
- private List<FeLibrary> SelectedLibs { get; set; } = new();
- private FeLibrary CurrentLibrary { get; set; }
- private FeDisc CurrentDisc { get; set; }
- protected override async Task OnInitializedAsync()
- {
- await base.OnInitializedAsync();
- if (FnzDataSet.AllLibrary?.Any() == true)
- {
- if (CurrentLibrary == null)
- {
- var f = FnzDataSet.AllLibrary.First();
- CurrentLibrary = f;
- SelectedLibs.Clear();
- SelectedLibs.Add(f);
- }
- StateHasChanged();
- }
- }
- public void SelectedLibraryChanged()
- {
- if (SelectedLibs.Count > 0)
- {
- CurrentLibrary = SelectedLibs.First();
- StateHasChanged();
- }
- }
- private void SelectDisc(FeDisc disc)
- {
- CurrentDisc = disc;
- StateHasChanged();
- Js.InvokeVoidAsync("ModalDiscShow");
- }
- }
- }
|