Files
mapo-core/MP.Stats/Pages/BasePage.cs
T
2021-07-02 19:05:05 +02:00

50 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Stats.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Stats.Pages
{
public class BasePage : ComponentBase, IDisposable
{
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected MessageService MessageService { get; set; }
[Inject]
protected NavigationManager NavManager { get; set; }
[Inject]
protected MpStatsService StatService { get; set; }
public virtual void Dispose()
{
MessageService.EA_SearchUpdated -= OnSeachUpdated;
}
public async void OnSeachUpdated()
{
await InvokeAsync(() =>
{
Task task = UpdateData();
StateHasChanged();
});
}
protected override async Task OnInitializedAsync()
{
clearFile();
numRecord = 10;
MessageService.ShowSearch = false;
MessageService.PageName = "TRS/OEE %";
MessageService.PageIcon = "oi oi-monitor";
MessageService.EA_SearchUpdated += OnSeachUpdated;
await reloadData();
}
}
}