using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System.Threading.Tasks; namespace MP.Land.Components { public partial class QrCodeDisplayJS { #region Public Properties [Parameter] public int Height { get; set; } = 200; [Parameter] public string ImgFormat { get; set; } = ""; [Parameter] public string objId { get; set; } = "qrCodeImg"; [Parameter] public string rawCode { get; set; } = "EmptyQr"; [Parameter] public int Width { get; set; } = 200; #endregion Public Properties #region Protected Properties [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; #endregion Protected Properties #region Protected Methods protected async Task InitDefault() { await JSRuntime.InvokeVoidAsync("displayQr", objId, rawCode); } protected override async Task OnAfterRenderAsync(bool firstRender) { await InitDefault(); } #endregion Protected Methods } }