-
Notifications
You must be signed in to change notification settings - Fork 93
Application got crash when load the PullToRefresh and Expander controls within different layouts. #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine
maui/src/Expander/SfExpander.cs
Outdated
if (width == 0) | ||
{ | ||
#if !WINDOWS | ||
var scaledScreenSize = new Size(DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density, DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
var scaledScreenSize = new Size(DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density, DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density); | |
var scaledScreenSize = | |
#if WINDOWS | |
new Size(300, 300); | |
#else | |
new Size(DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density, DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density); | |
#endif |
IMO it reads better and it would be easier to scale if we adapt it to more platforms in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bricefriha - Thanks for the suggestion — we have updated the code accordingly.
Bug Description
1.Application got crash when load the PullToRefresh controls within different layouts.
2.When setting the PullTorefresh API in GlobalStyles exception occurs.
3. Application crashes when setting the API's using Global Styling in Accordion and Expander control. Adding the Unit test cases for the Expander and Accordion.
Root Cause
1.The Layouts will have infinite width or height when it is measured in the control.So,it returns the infinite value because of that exception occurs.
2.When setting the PullTorefresh API in GlobalStyles the ProgressCircleView is null it is not loaded.So,that issue exception occurs in the layouts.
3.When setting the API in global styling ,while loading it calls the its API property changed methods first so in that items were not loaded .So items become null then the exception occurs.
Is Breaking issue?
No
Solution description
1.Manually added the height as 300 if the height is infinite and added width as 300 if the width is infinite for windows.For other than windows added the DeviceDisplay width and DeviceDisplay height for it.
2.Added the null check condition ProgressCircleView is not null for the API PropertyChanged methods.
3.Added the condition if the IsViewLoaded is false then it should return in the propertychanged methods.
Output screenshots
Windows:
Screen.Recording.2025-07-15.114653.mp4
Screen.Recording.2025-07-23.144743.mp4
Android:
Screen.Recording.2025-07-23.145601.mp4
Unit test case Image:

Areas affected and ensured
No areas were affected.
Test cases
Tested the Styles cases in all platforms.
Tested the Layout cases in all platforms.
Does it have any known issues?
No
MR CheckList