Class RadzenMediaQuery
public class RadzenMediaQuery : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
- Inheritance
-
RadzenMediaQuery
- Implements
- Inherited Members
Examples
< RadzenMediaQuery Query="(max-width: 768px)" Change=@OnChange /> @code { void OnChange(bool matches) { // matches is true if the media query applies; otherwise false. } }
Constructors
RadzenMediaQuery()
public RadzenMediaQuery()
Properties
Change
A callback that will be invoked when the status of the media query changes - to either match or not.
[Parameter]
public EventCallback<bool> Change { get; set; }
Property Value
Query
The CSS media query this component will listen for.
[Parameter]
public string Query { get; set; }
Property Value
Methods
Dispose()
Detaches client-side event listeners.
public void Dispose()
OnAfterRenderAsync(bool)
Called by the Blazor runtime. Initializes the media query on the client-side.
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnChange(bool)
Invoked by interop when media query changes.
[JSInvokable]
public Task OnChange(bool matches)
Parameters
matches
bool