A Razor UI component for s&box that renders a titled settings pane. It shows a title bar with a Label and a body area that renders supplied child content. It exposes Title, Revision and Body parameters and overrides BuildHash to depend on Title and Revision.
@using Sandbox;
@using Sandbox.UI;
@inherits Panel
@namespace Sandbox
<root>
<div class="title-bar">
<Label Tokenize=@false Text="@Title" />
</div>
<div class="settings-body">
@Body
</div>
</root>
@code
{
[Parameter] public string Title { get; set; }
/// <summary>
/// Bump this when the content changed in a way the title does not show, to make the pane build it again.
/// </summary>
[Parameter] public int Revision { get; set; }
[Parameter] public RenderFragment Body { get; set; }
protected override int BuildHash() => HashCode.Combine( Title, Revision );
}