diff --git a/src/Controls/src/Core/ContentPresenter.cs b/src/Controls/src/Core/ContentPresenter.cs index fb517a905715..109f1ca4eef5 100644 --- a/src/Controls/src/Core/ContentPresenter.cs +++ b/src/Controls/src/Core/ContentPresenter.cs @@ -107,7 +107,11 @@ static async void OnContentChanged(BindableObject bindable, object oldValue, obj newView.ParentOverride = await TemplateUtilities.FindTemplatedParentAsync((Element)bindable); } } + + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding MeasureOverride. protected override Size MeasureOverride(double widthConstraint, double heightConstraint) { return this.ComputeDesiredSize(widthConstraint, heightConstraint); @@ -118,6 +122,17 @@ Size ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint, double he return this.MeasureContent(widthConstraint, heightConstraint); } + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding OnSizeAllocated. + protected override void OnSizeAllocated(double width, double height) + { + base.OnSizeAllocated(width, height); + } + + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding ArrangeOverride. protected override Size ArrangeOverride(Rect bounds) { Frame = this.ComputeFrame(bounds); diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt index 7dc5c58110bf..8280d96141f8 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt index 7dc5c58110bf..8280d96141f8 100644 --- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index 7dc5c58110bf..8280d96141f8 100644 --- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 7dc5c58110bf..8280d96141f8 100644 --- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt index 7dc5c58110bf..8280d96141f8 100644 --- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt index 7dc5c58110bf..8280d96141f8 100644 --- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 7dc5c58110bf..8280d96141f8 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/ScrollView/ScrollView.cs b/src/Controls/src/Core/ScrollView/ScrollView.cs index 7c226a3b7565..fb2bfb21ef96 100644 --- a/src/Controls/src/Core/ScrollView/ScrollView.cs +++ b/src/Controls/src/Core/ScrollView/ScrollView.cs @@ -426,7 +426,11 @@ void IScrollView.RequestScrollTo(double horizontalOffset, double verticalOffset, } void IScrollView.ScrollFinished() => SendScrollFinished(); + + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding MeasureOverride. protected override Size MeasureOverride(double widthConstraint, double heightConstraint) { return this.ComputeDesiredSize(widthConstraint, heightConstraint); @@ -459,13 +463,25 @@ Size ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint, double he content.Measure(widthConstraint, heightConstraint); return content.DesiredSize; } + + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding ArrangeOverride. protected override Size ArrangeOverride(Rect bounds) { Frame = this.ComputeFrame(bounds); Handler?.PlatformArrange(Frame); return Frame.Size; + } + + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding OnSizeAllocated. + protected override void OnSizeAllocated(double width, double height) + { + base.OnSizeAllocated(width, height); } Size ICrossPlatformLayout.CrossPlatformArrange(Rect bounds) diff --git a/src/Controls/src/Core/TemplatedView/TemplatedView.cs b/src/Controls/src/Core/TemplatedView/TemplatedView.cs index 3e8cd53943bf..7d3dab03f4f5 100644 --- a/src/Controls/src/Core/TemplatedView/TemplatedView.cs +++ b/src/Controls/src/Core/TemplatedView/TemplatedView.cs @@ -126,7 +126,10 @@ partial void OnApplyTemplateImpl() { Handler?.UpdateValue(nameof(IContentView.Content)); } - + + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding MeasureOverride. protected override Size MeasureOverride(double widthConstraint, double heightConstraint) { return this.ComputeDesiredSize(widthConstraint, heightConstraint); @@ -137,6 +140,18 @@ Size ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint, double he return this.MeasureContent(widthConstraint, heightConstraint); } + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding OnSizeAllocated. + protected override void OnSizeAllocated(double width, double height) + { + base.OnSizeAllocated(width, height); + } + + + // Don't delete this override. At some point in the future we'd like to delete Compatibility.Layout + // and this is the only way to ensure binary compatibility with code that's already compiled against MAUI + // and is overriding ArrangeOverride. protected override Size ArrangeOverride(Rect bounds) { Frame = this.ComputeFrame(bounds);