75 lines
1.8 KiB
C#
75 lines
1.8 KiB
C#
using Blazored.LocalStorage;
|
|
using Microsoft.AspNetCore;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
using Microsoft.JSInterop;
|
|
using MP.Data.DTO;
|
|
using System.Reflection;
|
|
|
|
namespace MP.INVE.Shared
|
|
{
|
|
public partial class MainLayout
|
|
{
|
|
#region Protected Fields
|
|
|
|
protected string userName = "0";
|
|
|
|
#endregion Protected Fields
|
|
|
|
#region Protected Properties
|
|
|
|
protected bool navLarge { get; set; } = true;
|
|
|
|
protected string sideClass { get; set; } = "sidebar";
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected string remoteUserAgent = "--";
|
|
protected async Task getAgent()
|
|
{
|
|
remoteUserAgent = await JSRuntime.InvokeAsync<string>("getUserAgent");
|
|
}
|
|
|
|
public int Height { get; set; }
|
|
public int Width { get; set; }
|
|
|
|
public class WindowDimension
|
|
{
|
|
public int Width { get; set; }
|
|
public int Height { get; set; }
|
|
}
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
#if false
|
|
var dimension = await JSRuntime.InvokeAsync<WindowDimension>("getWindowDimensions");
|
|
Height = dimension.Height;
|
|
Width = dimension.Width;
|
|
#endif
|
|
await getAgent();
|
|
}
|
|
|
|
protected void UpdateNavDisplay()
|
|
{
|
|
navLarge = !navLarge;
|
|
sideClass = navLarge ? "sidebar" : "sidebarSmall";
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Properties
|
|
|
|
[Inject]
|
|
private ILocalStorageService localStorage { get; set; } = null!;
|
|
|
|
[Inject]
|
|
private NavigationManager NavManager { get; set; } = null!;
|
|
|
|
[Inject]
|
|
private IJSRuntime JSRuntime { get; set; } = null!;
|
|
|
|
#endregion Private Properties
|
|
}
|
|
} |