@using Blazored.Modal;
@using Blazored.Modal.Services;
@inject Blazored.Modal.Services.IModalService Modal

<h4>Détails de l'élément</h4>
<p>Ceci est un contenu chargé dans une modale.</p>
<p>@DisplayMessage</p>

<button class="btn btn-primary" @onclick="Close">Fermer</button>
<button class="btn btn-primary" @onclick="Cancel">Annuler</button>

@code {
    [CascadingParameter] public ModalParameters? Parameters { get; set; }
    [CascadingParameter] BlazoredModalInstance ModalInstance { get; set; } = default!;
    [Parameter] public string? DisplayMessage { get; set; }

    private async Task Close() => await ModalInstance.CloseAsync();
    private async Task Cancel() => await ModalInstance.CancelAsync();
}                