Class MudExpansionPanel
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
A component which can be expanded to show more content or collapsed to show only its header.
public class MudExpansionPanel : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IDisposable
- Inheritance
-
MudExpansionPanel
- Implements
- Inherited Members
- Extension Methods
Remarks
This component is always inside a MudExpansionPanels component.
Constructors
MudExpansionPanel()
Creates a new instance.
public MudExpansionPanel()
Properties
ChildContent
The content within this panel.
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Dense
Removes vertical padding from the panel.
[Parameter]
[Category("Appearance")]
public bool Dense { get; set; }
Property Value
Remarks
Defaults to false
.
Disabled
Disables user interaction and prevents ToggleExpansionAsync().
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
Remarks
Defaults to false
.
Expanded
Displays the panel content.
[Parameter]
[Category("Behavior")]
public bool Expanded { get; set; }
Property Value
Remarks
Defaults to false
.
ExpandedChanged
Occurs when Expanded has changed.
[Parameter]
public EventCallback<bool> ExpandedChanged { get; set; }
Property Value
Gutters
Adds left and right padding.
[Parameter]
[Category("Appearance")]
public bool Gutters { get; set; }
Property Value
Remarks
Defaults to true
.
HeaderClass
User class names, separated by space.
[Parameter]
[Category("Appearance")]
public string? HeaderClass { get; set; }
Property Value
HeaderClassname
protected string HeaderClassname { get; }
Property Value
HideIcon
Hides the expand icon.
[Parameter]
[Category("Appearance")]
public bool HideIcon { get; set; }
Property Value
Remarks
Defaults to false
.
Icon
The icon for expanding this panel.
[Parameter]
[Category("Appearance")]
public string Icon { get; set; }
Property Value
Remarks
Defaults to ExpandMore.
MaxHeight
The maximum allowed height, in pixels.
[Parameter]
[Category("Appearance")]
public int? MaxHeight { get; set; }
Property Value
- int?
Remarks
Defaults to null
. When null
, the CSS default is used for maximum height.
NextPanelExpanded
Indicates whether the next panel is currently expanded.
public bool NextPanelExpanded { get; set; }
Property Value
PanelContentClassname
protected string PanelContentClassname { get; }
Property Value
Text
The text displayed in this panel, if TitleContent is not set.
[Parameter]
[Category("Behavior")]
public string? Text { get; set; }
Property Value
Remarks
Defaults to null
.
TitleContent
The content within the title area.
[Parameter]
[Category("Behavior")]
public RenderFragment? TitleContent { get; set; }
Property Value
Remarks
Defaults to null
. When set, overrides the Text property.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
CollapseAsync()
Hides the content in this panel.
public Task CollapseAsync()
Returns
Dispose()
Releases resources used by this panel.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
ExpandAsync()
Shows the content in this panel.
public Task ExpandAsync()
Returns
OnInitializedAsync()
protected override Task OnInitializedAsync()
Returns
ToggleExpansionAsync()
Shows or hides the content in this panel.
public Task ToggleExpansionAsync()
Returns
Remarks
If Disabled is true
, this method has no affect.