When setting WidthRequest on TemplateFromXaml in Rotator it doesnt render the page.

Hi,

We have a Maui app that uses a SfRotator that loads the templates from xaml files.

We are trying to set the WidthRequest on these templates from the TemplateViewModel when they are loaded.

I have created a Sample app and you can see what happens below. This is only a problem on Windows, this sample app works on Android as excpected.


Below you can see the code I have added. When the code is there then the page doesnt render inside the rotator. When you comment out the code of setting the WidthRequest you can see that the page renders.

Image_5519_1721119462579

You can see below the page does not render:
Image_5235_1721119659790


Below you can see when the page renders when the code is commented out:

Image_2811_1721119876148


I also noted that when I set the WidthRequest in xaml like below. That it also doesnt render.
Image_8569_1721120033427


I have attatched the project as a zip file.

Can you please investigate and let me know if it is a bug or if there is a fix.

Thanks,
Mark

Attachment: SyncfusionWidthInTemplateTest_61a8de89.zip

3 Replies

AA Aarthi Arjunan Syncfusion Team July 17, 2024 01:40 PM UTC

Hi Mark,

 

Thank you for reaching out to us. We have investigated your query based on your update. We have found that you are adding WidthRequest to Rotator item template in prism framework.  We suggest you to use MaximumWidthRequest instead of WidthRequest. Please refer to the below code snippets for more details:

 

templateControlFromXaml.MaximumWidthRequest = 600;

 

Please let us know whether the provided suggestion helps to resolve your query. Don’t hesitate to contact us if you have any concerns or queries.

 

Regards,

Aarthi A.



MA Mark replied to Aarthi Arjunan July 18, 2024 11:59 AM UTC

Hi Aarthi,


Thanks for the quick response and this suggestion. I have got it working in our app.


Thanks,

Mark



PR Preethi Rajakandham Syncfusion Team July 19, 2024 05:18 AM UTC

Hi Mark,

You're welcome. 

We are glad that the provided response meets your requirement. Please let us know if you need further assistance. As always, we are happy to help you out.

Regards,

Preethi R


Loader.
Up arrow icon