RadzenMediaQuery fires its Change event when the media query specified via Query matches or not.
Object
ComponentBase
IComponent
IHandleEvent
IHandleAfterRender
ComponentBase.BuildRenderTree
ComponentBase.OnInitialized
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.SetParametersAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenMediaQuery : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender< RadzenMediaQuery Query="(max-width: 768px)" Change=@OnChange /> @code { void OnChange(bool matches) { // matches is true if the media query applies; otherwise false. } }
RadzenMediaQuery fires its Change event when the media query specified via Query matches or not.
public RadzenMediaQuery()A callback that will be invoked when the status of the media query changes - to either match or not.
public EventCallback<bool> Change { get; set; }
| Type | Description |
|---|---|
| EventCallback<bool> | A callback that will be invoked when the status of the media query changes - to either match or not. |
The CSS media query this component will listen for.
public string Query { get; set; }
| Type | Description |
|---|---|
| string | The CSS media query this component will listen for. |
Called by the Blazor runtime. Initializes the media query on the client-side.
protected override Task OnAfterRenderAsync(bool firstRender)
| Type | Name | Description |
|---|---|---|
| bool | firstRender |
| Type | Description |
|---|---|
| Task |
Invoked by interop when media query changes.
public Task OnChange(bool matches)
| Type | Name | Description |
|---|---|---|
| bool | matches |
| Type | Description |
|---|---|
| Task |