53 lines
1.2 KiB
C#
53 lines
1.2 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace MagMan.UI.Components
|
|
{
|
|
public partial class CmpTop
|
|
{
|
|
#region Private Properties
|
|
|
|
private string PageIcon { get; set; } = "";
|
|
|
|
private string PageName { get; set; } = "";
|
|
|
|
[CascadingParameter(Name = "ShowSearch")]
|
|
private bool ShowSearch { get; set; } = false;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Public Methods
|
|
|
|
public void Dispose()
|
|
{
|
|
AppMessages.EA_PageUpdated -= OnPageUpdate;
|
|
}
|
|
|
|
public void OnPageUpdate()
|
|
{
|
|
PageName = AppMessages.PageName;
|
|
PageIcon = AppMessages.PageIcon;
|
|
InvokeAsync(() =>
|
|
{
|
|
StateHasChanged();
|
|
});
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
AppMessages.EA_PageUpdated += OnPageUpdate;
|
|
}
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await Task.Delay(0);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |