Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions maui/src/Core/BaseView/DrawableLayoutView/SfView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public abstract class SfView : View, IDrawableLayout, IVisualTreeElement, ISeman

private bool clipToBounds = true;

/// <summary>
/// The field indicates whether it is layout based control.
/// </summary>
private bool isLayoutControl = false;

private Thickness padding = new(0);

readonly List<IView> children = [];
Expand Down Expand Up @@ -64,6 +69,21 @@ internal bool IgnoreSafeArea
}
}

/// <summary>
/// Gets or sets a value indicating whether it is layout based control.
/// </summary>
internal bool IsLayoutControl
{
get
{
return this.isLayoutControl;
}
set
{
this.isLayoutControl = value;
}
}

/// <summary>
/// Gets the collection of child views contained within this view.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion maui/src/Core/BaseView/PlatformView/LayoutViewExt.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public override void LayoutSubviews()
var widthConstraint = bounds.Width;
var heightConstraint = bounds.Height;

if (!IsMeasureValid(widthConstraint, heightConstraint) && Superview is not Microsoft.Maui.Platform.MauiView)
if (!IsMeasureValid(widthConstraint, heightConstraint) && Superview is not Microsoft.Maui.Platform.MauiView && View is SfView sfView && !sfView.IsLayoutControl)
{
layout.CrossPlatformMeasure(bounds.Width, bounds.Height);
CacheMeasureConstraints(widthConstraint, heightConstraint);
Expand Down
5 changes: 3 additions & 2 deletions maui/src/PullToRefresh/SfPullToRefresh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public partial class SfPullToRefresh : PullToRefreshBase, ITouchListener, IParen
typeof(ICommand),
typeof(SfPullToRefresh),
null,
BindingMode.TwoWay,
BindingMode.Default,
null);

/// <summary>
Expand All @@ -127,7 +127,7 @@ public partial class SfPullToRefresh : PullToRefreshBase, ITouchListener, IParen
typeof(object),
typeof(SfPullToRefresh),
null,
BindingMode.TwoWay,
BindingMode.Default,
null);

/// <summary>
Expand Down Expand Up @@ -360,6 +360,7 @@ public SfPullToRefresh()
Children.Add(_progressCircleView);
ClipToBounds = true;
ThemeElement.InitializeThemeResources(this, "SfPullToRefreshTheme");
this.IsLayoutControl = true;
}

#endregion
Expand Down