Inject MediaQuery into code behind

1 Answer 35 Views
MediaQuery
Rob
Top achievements
Rank 1
Veteran
Rob asked on 14 May 2021, 01:36 PM

I was using Ed Charbenaeau's BlazorSize, but wanted to remove the extra dependency now that similar functionality is built into UI for Blazor.

Is there an analogue to the IResizeListener/ResizeListener class? I have a base class component that's injecting IResizeListener, I didn't see a method to do that with Telerik.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 May 2021, 09:54 AM

Hi Rob,

The Telerik UI for Blazor suite does not provide a service for the window.resize event the browser raises. If you need that, you can implement your own, or use a third-party library like BlazorSize.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Greg
Top achievements
Rank 1
commented on 16 Sep 2021, 09:24 PM

The BlazorSize site says the exact opposite - that you do NOT need to use it when using Telerik MediaQuery. Which is correct?
Rob
Top achievements
Rank 1
Veteran
commented on 16 Sep 2021, 09:40 PM

The website is correct for the MediaQuery component. However Blazorsize also has a resizelistener class that triggers events on resize, Telerik Blazor doesn't have an equivalent for this. 




 

Tags
MediaQuery
Asked by
Rob
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Share this question
or