diff --git a/src/Core/src/Handlers/ContentView/ContentViewHandler.Tizen.cs b/src/Core/src/Handlers/ContentView/ContentViewHandler.Tizen.cs index b6d4eba46dfd..11801de0aec6 100644 --- a/src/Core/src/Handlers/ContentView/ContentViewHandler.Tizen.cs +++ b/src/Core/src/Handlers/ContentView/ContentViewHandler.Tizen.cs @@ -39,6 +39,12 @@ public override void SetVirtualView(IView view) NativeView.CrossPlatformArrange = VirtualView.CrossPlatformArrange; } + public static void MapBackground(ContentViewHandler handler, IContentView view) + { + handler.UpdateValue(nameof(handler.ContainerView)); + handler.GetWrappedNativeView()?.UpdateBackground(view); + } + public static void MapContent(ContentViewHandler handler, IContentView page) { handler.UpdateContent(); diff --git a/src/Core/src/Handlers/ContentView/ContentViewHandler.cs b/src/Core/src/Handlers/ContentView/ContentViewHandler.cs index 69f05be68e58..f2a214709e73 100644 --- a/src/Core/src/Handlers/ContentView/ContentViewHandler.cs +++ b/src/Core/src/Handlers/ContentView/ContentViewHandler.cs @@ -6,6 +6,9 @@ public partial class ContentViewHandler public static IPropertyMapper ContentViewMapper = new PropertyMapper(ViewMapper) { [nameof(IContentView.Content)] = MapContent, +#if TIZEN + [nameof(IContentView.Background)] = MapBackground, +#endif }; public static CommandMapper ContentViewCommandMapper = new(ViewCommandMapper) diff --git a/src/Core/src/Handlers/Editor/EditorHandler.Tizen.cs b/src/Core/src/Handlers/Editor/EditorHandler.Tizen.cs index 1cf7fd42a592..769f88bd4d25 100644 --- a/src/Core/src/Handlers/Editor/EditorHandler.Tizen.cs +++ b/src/Core/src/Handlers/Editor/EditorHandler.Tizen.cs @@ -33,6 +33,12 @@ protected override void DisconnectHandler(Entry nativeView) nativeView.TextChanged -= OnTextChanged; } + public static void MapBackground(EditorHandler handler, IEditor editor) + { + handler.UpdateValue(nameof(handler.ContainerView)); + handler.GetWrappedNativeView()?.UpdateBackground(editor); + } + public static void MapText(EditorHandler handler, IEditor editor) { handler.NativeView?.UpdateText(editor); diff --git a/src/Core/src/Handlers/Editor/EditorHandler.cs b/src/Core/src/Handlers/Editor/EditorHandler.cs index 7a30af7c18d8..22208c536940 100644 --- a/src/Core/src/Handlers/Editor/EditorHandler.cs +++ b/src/Core/src/Handlers/Editor/EditorHandler.cs @@ -5,7 +5,7 @@ public partial class EditorHandler { public static IPropertyMapper EditorMapper = new PropertyMapper(ViewHandler.ViewMapper) { -#if __ANDROID__ +#if __ANDROID__ || TIZEN [nameof(IEditor.Background)] = MapBackground, #endif [nameof(IEditor.CharacterSpacing)] = MapCharacterSpacing, diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs index 899f1fdbc6b1..bc91c738cc6f 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs @@ -54,6 +54,12 @@ protected override void DisconnectHandler(Entry nativeView) nativeView.EntryLayoutUnfocused -= OnUnfocused; } + public static void MapBackground(EntryHandler handler, IEntry entry) + { + handler.UpdateValue(nameof(handler.ContainerView)); + handler.GetWrappedNativeView()?.UpdateBackground(entry); + } + public static void MapText(EntryHandler handler, IEntry entry) { handler.NativeView?.UpdateText(entry); diff --git a/src/Core/src/Handlers/Entry/EntryHandler.cs b/src/Core/src/Handlers/Entry/EntryHandler.cs index 2a6351665a9b..6864052f8f84 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.cs @@ -7,7 +7,7 @@ public partial class EntryHandler { public static IPropertyMapper EntryMapper = new PropertyMapper(ViewHandler.ViewMapper) { -#if __ANDROID__ +#if __ANDROID__ || TIZEN [nameof(IEntry.Background)] = MapBackground, #endif [nameof(IEntry.CharacterSpacing)] = MapCharacterSpacing, diff --git a/src/Core/src/Handlers/Label/LabelHandler.Tizen.cs b/src/Core/src/Handlers/Label/LabelHandler.Tizen.cs index 535dc104bb70..a2a56fd62e50 100644 --- a/src/Core/src/Handlers/Label/LabelHandler.Tizen.cs +++ b/src/Core/src/Handlers/Label/LabelHandler.Tizen.cs @@ -17,6 +17,12 @@ protected override Label CreateNativeView() return label; } + public static void MapBackground(LabelHandler handler, ILabel label) + { + handler.UpdateValue(nameof(handler.ContainerView)); + handler.GetWrappedNativeView()?.UpdateBackground(label); + } + public static void MapText(LabelHandler handler, ILabel label) { handler.NativeView?.UpdateText(label); diff --git a/src/Core/src/Handlers/Label/LabelHandler.cs b/src/Core/src/Handlers/Label/LabelHandler.cs index 684e5e1a4783..d391b4450911 100644 --- a/src/Core/src/Handlers/Label/LabelHandler.cs +++ b/src/Core/src/Handlers/Label/LabelHandler.cs @@ -5,7 +5,7 @@ public partial class LabelHandler { public static IPropertyMapper LabelMapper = new PropertyMapper(ViewHandler.ViewMapper) { -#if WINDOWS || __IOS__ +#if WINDOWS || __IOS__ || TIZEN [nameof(ILabel.Background)] = MapBackground, #endif [nameof(ILabel.CharacterSpacing)] = MapCharacterSpacing, diff --git a/src/Core/src/Handlers/Layout/LayoutHandler.cs b/src/Core/src/Handlers/Layout/LayoutHandler.cs index 7ab7ccdaaf92..355c1ed21aa1 100644 --- a/src/Core/src/Handlers/Layout/LayoutHandler.cs +++ b/src/Core/src/Handlers/Layout/LayoutHandler.cs @@ -43,6 +43,10 @@ public LayoutHandler(IPropertyMapper? mapper = null, CommandMapper? commandMappe public static void MapBackground(ILayoutHandler handler, ILayout layout) { +#if TIZEN + handler.UpdateValue(nameof(handler.ContainerView)); + handler.GetWrappedNativeView()?.UpdateBackground(layout); +#endif ((NativeView?)handler.NativeView)?.UpdateBackground(layout); } diff --git a/src/Core/src/Handlers/Page/PageHandler.Tizen.cs b/src/Core/src/Handlers/Page/PageHandler.Tizen.cs index 8259aef8a780..2991fbdf4e58 100644 --- a/src/Core/src/Handlers/Page/PageHandler.Tizen.cs +++ b/src/Core/src/Handlers/Page/PageHandler.Tizen.cs @@ -1,15 +1,20 @@ -using Tizen.UIExtensions.Common; -using EColor = ElmSharp.Color; +using EColor = ElmSharp.Color; namespace Microsoft.Maui.Handlers { public partial class PageHandler : ContentViewHandler { - public static void MapTitle(PageHandler handler, IContentView page) + public static void MapBackground(PageHandler handler, IContentView page) { + handler.UpdateValue(nameof(handler.ContainerView)); + if (page.Background != null && handler.NativeView.BackgroundColor != EColor.Transparent) + { + handler.NativeView.BackgroundColor = EColor.Transparent; + } + handler.GetWrappedNativeView()?.UpdateBackground(page); } - protected override ContentCanvas CreateNativeView() + public static void MapTitle(PageHandler handler, IContentView page) { var view = base.CreateNativeView(); view.BackgroundColor = (DeviceInfo.GetDeviceType() == DeviceType.TV) ? EColor.Transparent : EColor.White; diff --git a/src/Core/src/Handlers/Page/PageHandler.cs b/src/Core/src/Handlers/Page/PageHandler.cs index 3e892c726862..3d030932b714 100644 --- a/src/Core/src/Handlers/Page/PageHandler.cs +++ b/src/Core/src/Handlers/Page/PageHandler.cs @@ -5,6 +5,9 @@ public partial class PageHandler : ContentViewHandler { public static IPropertyMapper PageMapper = new PropertyMapper(ContentViewMapper) { +#if TIZEN + [nameof(IContentView.Background)] = MapBackground, +#endif [nameof(ITitledElement.Title)] = MapTitle }; diff --git a/src/Core/src/Handlers/View/ViewHandler.cs b/src/Core/src/Handlers/View/ViewHandler.cs index 8d9f247868df..5a72e9996e97 100644 --- a/src/Core/src/Handlers/View/ViewHandler.cs +++ b/src/Core/src/Handlers/View/ViewHandler.cs @@ -183,12 +183,7 @@ public static void MapVisibility(IViewHandler handler, IView view) public static void MapBackground(IViewHandler handler, IView view) { -#if TIZEN - handler.UpdateValue(nameof(IViewHandler.ContainerView)); - handler.GetWrappedNativeView()?.UpdateBackground(view); -#else ((NativeView?)handler.NativeView)?.UpdateBackground(view); -#endif } public static void MapFlowDirection(IViewHandler handler, IView view)