mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 11:20:05 +02:00
feat: implemented Mediator and added dialog service
This commit is contained in:
1 parent
ec977c490a
commit
38c631bc44
13 files changed
+188
-54
No files matched your search
@@ -0,0 +1,44 @@
|
||||
using System.Threading;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Radzen;
|
||||
using Radzen.Blazor;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Blazor.Shared
|
||||
{
|
||||
public class MainLayoutBase: LayoutComponentBase
|
||||
{
|
||||
[Inject]
|
||||
private DialogService DialogService { get; set; }
|
||||
|
||||
public RadzenSidebar Sidebar0;
|
||||
public RadzenBody Body0;
|
||||
public bool SidebarExpanded { get; set; } = false;
|
||||
public bool BodyExpanded { get; set; } = true;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
//if (httpContextAccessor != null && httpContextAccessor.HttpContext != null &&
|
||||
// httpContextAccessor.HttpContext.Request != null && httpContextAccessor.HttpContext.Request.Headers.ContainsKey("User-Agent"))
|
||||
//{
|
||||
// var userAgent = httpContextAccessor.HttpContext.Request.Headers["User-Agent"].FirstOrDefault();
|
||||
// if (!string.IsNullOrEmpty(userAgent))
|
||||
// {
|
||||
// if (userAgent.Contains("iPhone") || userAgent.Contains("Android") || userAgent.Contains("Googlebot"))
|
||||
// {
|
||||
// SidebarExpanded = false;
|
||||
// BodyExpanded = true;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
|
||||
}
|
||||
|
||||
public void InvertSideBar()
|
||||
{
|
||||
SidebarExpanded = !SidebarExpanded;
|
||||
BodyExpanded = !BodyExpanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user