File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,10 @@ public static void SetSize(this MauiPopup mauiPopup, in IPopup popup)
2323 else if ( popup . Content is not null )
2424 {
2525 var content = popup . Content ;
26- if ( ! content . Width . IsZeroOrNaN ( ) || ! content . Height . IsZeroOrNaN ( ) )
27- {
28- mauiPopup . PreferredContentSize = new CGSize ( content . Width , content . Height ) ;
29- }
30- else
31- {
32- var measure = popup . Content . Measure ( double . PositiveInfinity , double . PositiveInfinity ) ;
33- mauiPopup . PreferredContentSize = new CGSize ( measure . Width , measure . Height ) ;
34- }
26+ var measure = popup . Content . Measure ( double . PositiveInfinity , double . PositiveInfinity ) ;
27+ var width = content . Width . IsZeroOrNaN ( ) ? measure . Width : content . Width ;
28+ var height = content . Height . IsZeroOrNaN ( ) ? measure . Height : content . Height ;
29+ mauiPopup . PreferredContentSize = new CGSize ( width , height ) ;
3530 }
3631 }
3732
You can’t perform that action at this time.
0 commit comments