Class MudHidden
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
A component which conditionally renders content depending on the screen size.
public class MudHidden : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IBrowserViewportObserver, IAsyncDisposable
- Inheritance
-
MudHidden
- Implements
- Inherited Members
- Extension Methods
Remarks
This component uses JavaScript to listen for browser window size changes. If you want a solution using only CSS, you can use the responsive display classes.
Constructors
MudHidden()
public MudHidden()
Properties
Breakpoint
The breakpoint at which component is not rendered, when Invert is false
.
[Parameter]
[Category("Behavior")]
public Breakpoint Breakpoint { get; set; }
Property Value
Remarks
When Invert is true
, this property controls when the content is shown.
BrowserViewportService
[Inject]
protected IBrowserViewportService BrowserViewportService { get; set; }
Property Value
ChildContent
The content within this component.
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
CurrentBreakpointFromProvider
The current breakpoint.
[CascadingParameter]
public Breakpoint CurrentBreakpointFromProvider { get; set; }
Property Value
Remarks
Defaults to None.
Hidden
Hides the content within this component.
[Parameter]
[Category("Behavior")]
public bool Hidden { get; set; }
Property Value
Remarks
Defaults to true
.
HiddenChanged
Occurs when Hidden has changed.
[Parameter]
public EventCallback<bool> HiddenChanged { get; set; }
Property Value
Invert
Causes the Breakpoint to control when content is displayed.
[Parameter]
[Category("Behavior")]
public bool Invert { get; set; }
Property Value
Remarks
Defaults to false
.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
DisposeAsync()
Releases resources used by this component.
public ValueTask DisposeAsync()
Returns
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnParametersSetAsync()
protected override Task OnParametersSetAsync()
Returns
UpdateAsync(Breakpoint)
protected Task UpdateAsync(Breakpoint currentBreakpoint)
Parameters
currentBreakpoint
Breakpoint