diff --git a/src/Core/src/Handlers/Page/PageHandler.cs b/src/Core/src/Handlers/Page/PageHandler.cs index 8e7c097110f3..dfbae9a27359 100644 --- a/src/Core/src/Handlers/Page/PageHandler.cs +++ b/src/Core/src/Handlers/Page/PageHandler.cs @@ -6,7 +6,7 @@ public partial class PageHandler : ContentViewHandler, IPageHandler public static new IPropertyMapper Mapper = new PropertyMapper(ContentViewHandler.Mapper) { -#if TIZEN +#if IOS || TIZEN [nameof(IContentView.Background)] = MapBackground, #endif [nameof(ITitledElement.Title)] = MapTitle, diff --git a/src/Core/src/Handlers/Page/PageHandler.iOS.cs b/src/Core/src/Handlers/Page/PageHandler.iOS.cs index 639f5f59d4f8..f15e95a9ec03 100644 --- a/src/Core/src/Handlers/Page/PageHandler.iOS.cs +++ b/src/Core/src/Handlers/Page/PageHandler.iOS.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using UIKit; - +using System; namespace Microsoft.Maui.Handlers { @@ -24,9 +21,17 @@ protected override ContentView CreatePlatformView() throw new InvalidOperationException($"PageViewController.View must be a {nameof(ContentView)}"); } + public static void MapBackground(IPageHandler handler, IContentView page) + { + if (handler is IPlatformViewHandler invh && invh.ViewController is not null) + { + invh.ViewController.View?.UpdateBackground(page); + } + } + public static void MapTitle(IPageHandler handler, IContentView page) { - if (handler is IPlatformViewHandler invh && invh.ViewController != null) + if (handler is IPlatformViewHandler invh && invh.ViewController is not null) { if (page is ITitledElement titled) { diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index e34952ca4407..a932a4f30ee7 100644 --- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -66,6 +66,7 @@ static Microsoft.Maui.CommandMapperExtensions.PrependToMapping(this Microsoft.Maui.ICommandMapper! commandMapper, string! key, System.Action! method) -> void static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.PageHandler.MapBackground(Microsoft.Maui.Handlers.IPageHandler! handler, Microsoft.Maui.IContentView! page) -> void static Microsoft.Maui.Handlers.EditorHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEditorHandler! handler, Microsoft.Maui.IEditor! editor) -> void static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.SearchBarHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index b3f26d213972..a55fba311d04 100644 --- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -68,6 +68,7 @@ static Microsoft.Maui.CommandMapperExtensions.PrependToMapping(this Microsoft.Maui.ICommandMapper! commandMapper, string! key, System.Action! method) -> void static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.PageHandler.MapBackground(Microsoft.Maui.Handlers.IPageHandler! handler, Microsoft.Maui.IContentView! page) -> void static Microsoft.Maui.Handlers.EditorHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEditorHandler! handler, Microsoft.Maui.IEditor! editor) -> void static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.SearchBarHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void