BrowseView.razor.cs 1010 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using FNZCM.BlazorWasm.Models;
  2. namespace FNZCM.BlazorWasm.UI.Views.Browse
  3. {
  4. public partial class BrowseView
  5. {
  6. private DiscDialog ModalDisc { get; set; }
  7. private FeLibrary CurrentLibrary { get; set; }
  8. private FeDisc CurrentDisc { get; set; }
  9. protected override async Task OnInitializedAsync()
  10. {
  11. await base.OnInitializedAsync();
  12. if (FnzDataSet.AllLibrary?.Any() == true)
  13. {
  14. if (CurrentLibrary == null)
  15. {
  16. var f = FnzDataSet.AllLibrary.First();
  17. CurrentLibrary = f;
  18. }
  19. StateHasChanged();
  20. }
  21. }
  22. public void SelectedLibraryChanged(FeLibrary lib)
  23. {
  24. CurrentLibrary = lib;
  25. StateHasChanged();
  26. }
  27. private void SelectDisc(FeDisc disc)
  28. {
  29. CurrentDisc = disc;
  30. StateHasChanged();
  31. ModalDisc.Show();
  32. }
  33. }
  34. }