2022-08-26 13:13:40 -05:00
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using NftFaucetRadzen.Models;
|
|
|
|
using NftFaucetRadzen.Options;
|
2022-08-27 12:37:49 -05:00
|
|
|
using NftFaucetRadzen.Services;
|
|
|
|
using NftFaucetRadzen.Services.Abstractions;
|
2022-08-26 13:13:40 -05:00
|
|
|
|
|
|
|
namespace NftFaucetRadzen.Components;
|
|
|
|
|
|
|
|
public abstract class BasicComponent : ComponentBase
|
|
|
|
{
|
|
|
|
[Inject]
|
|
|
|
protected NavigationManager UriHelper { get; set; }
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
protected ScopedAppState AppState { get; set; }
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
protected RefreshMediator RefreshMediator { get; set; }
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
protected Settings Settings { get; set; }
|
|
|
|
|
2022-08-27 12:37:49 -05:00
|
|
|
[Inject]
|
|
|
|
protected IPluginLoader PluginLoader { get; set; }
|
|
|
|
|
2022-08-26 13:13:40 -05:00
|
|
|
protected override void OnInitialized()
|
|
|
|
{
|
|
|
|
RefreshMediator.StateChanged += async () => await InvokeAsync(StateHasChangedSafe);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void StateHasChangedSafe()
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
InvokeAsync(StateHasChanged);
|
|
|
|
}
|
|
|
|
catch (Exception)
|
|
|
|
{
|
|
|
|
// ignored
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|