Add MaxHeight and ExpandedChanged parameters to expansion panel

This commit is contained in:
Thorsten Sommer 2025-05-29 21:27:18 +02:00
parent 0a4bb85e77
commit 53a3d0544c
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
<MudExpansionPanel Class="border-solid border rounded-lg" Expanded="@this.IsExpanded"> <MudExpansionPanel Class="border-solid border rounded-lg" Expanded="@this.IsExpanded" MaxHeight="@this.MaxHeight" ExpandedChanged="async s => await this.ExpandedChanged(s)">
<TitleContent> <TitleContent>
<div class="d-flex align-center"> <div class="d-flex align-center">
<MudIcon Icon="@this.HeaderIcon" Size="@this.IconSize" Color="@this.IconColor" class="mr-3"/> <MudIcon Icon="@this.HeaderIcon" Size="@this.IconSize" Color="@this.IconColor" class="mr-3"/>

View File

@ -16,6 +16,12 @@ public partial class ExpansionPanel : ComponentBase
[Parameter] [Parameter]
public string HeaderText { get; set; } = "n/a"; public string HeaderText { get; set; } = "n/a";
[Parameter]
public int? MaxHeight { get; set; }
[Parameter]
public Func<bool, Task> ExpandedChanged { get; set; } = _ => Task.CompletedTask;
[Parameter] [Parameter]
public RenderFragment? ChildContent { get; set; } public RenderFragment? ChildContent { get; set; }