public async Task LoadSongsAsync() { var getSongsResponse = await _songService.GetSongsAsync(); if (getSongsResponse.HasError) { await _modalService.ShowAsync("Erreur lors du chargement des musiques", getSongsResponse.ErrorMessage); } else { Songs = getSongsResponse.Content; } }
public static async Task <DialogResult> ShowMessageAsync(this IModalService service, string?title, string?text, MessageBoxButtons buttons, bool requireInteraction = true) { var model = new MessageBoxModel() { Title = title, Text = text, Buttons = buttons, RequireInteraction = requireInteraction }; await service.ShowAsync(model); return(model.DialogResult); }