Files
egwcorelib/EgwCoreLib.Razor/PdfViewer.razor.cs
T
2024-02-22 09:53:12 +01:00

37 lines
934 B
C#

using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
namespace EgwCoreLib.Razor
{
public partial class PdfViewer
{
/// <summary>
/// URL del documento da mostrare
/// </summary>
[Parameter]
public string PdfUrl { get; set; } = "";
/// <summary>
/// Larghezza desiderata
/// </summary>
public string Width { get; set; } = "100%";
/// <summary>
/// Altezza desiderata
/// </summary>
public string Height { get; set; } = "60%";
/// <summary>
/// Boolean Mobile vs Desktop
/// </summary>
private bool isMobile { get; set; }
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
isMobile = await JSRuntime.InvokeAsync<bool>("isDevice");
}
}
}