Files
mapo-core/MP.Land/Components/QrCodeDisplayJS.razor.cs
2024-07-19 16:54:36 +02:00

49 lines
1.1 KiB
C#

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
}
}