48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AyCode.Blazor.Components.Components.Grids;
|
|
|
|
/// <summary>
|
|
/// Base class for custom InfoPanel templates.
|
|
/// Inherit from this class to create a custom InfoPanel for a specific grid.
|
|
/// </summary>
|
|
public abstract class MgInfoPanelTemplateBase : MgGridInfoPanel
|
|
{
|
|
/// <summary>
|
|
/// Override this to provide custom header content.
|
|
/// Return null to use default header.
|
|
/// </summary>
|
|
protected virtual RenderFragment? GetHeaderTemplate() => null;
|
|
|
|
/// <summary>
|
|
/// Override this to provide custom columns/content.
|
|
/// Return null to use auto-generated columns.
|
|
/// </summary>
|
|
protected virtual RenderFragment? GetColumnsTemplate() => null;
|
|
|
|
/// <summary>
|
|
/// Override this to provide custom footer content.
|
|
/// Return null to hide footer.
|
|
/// </summary>
|
|
protected virtual RenderFragment? GetFooterTemplate() => null;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
SetTemplates();
|
|
base.OnInitialized();
|
|
}
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
SetTemplates();
|
|
base.OnParametersSet();
|
|
}
|
|
|
|
private void SetTemplates()
|
|
{
|
|
HeaderTemplate = GetHeaderTemplate();
|
|
ColumnsTemplate = GetColumnsTemplate();
|
|
FooterTemplate = GetFooterTemplate();
|
|
}
|
|
}
|