@inject IJSRuntime jsRuntime @implements IDialog
@code { [Parameter] public string? Title { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } [Parameter] public int HeightPixels { set => height = $"{value}px"; } [Parameter] public int HeightPercent { set => height = $"{value}%"; } public bool Visible { get => visible; set { visible = value; jsRuntime.InvokeVoidAsync( "setDialogVisibility", new object?[] { dialogDiv, value }); } } private bool visible = false; private string? height; private ElementReference dialogDiv; public void Show() => Visible = true; public void Hide() => Visible = false; private string heightStyle => $"{(height is null ? "" : $"max-height:{height};")}"; }