37 lines
934 B
C#
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");
|
|
}
|
|
}
|
|
} |