From aab74ad04ed08d711ddf80a6a3f72538281bb23d Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Tue, 3 Dec 2024 18:37:08 +0900 Subject: [PATCH] [NUI] Notify background change with magic keyword Signed-off-by: Jiyun Yang --- src/Tizen.NUI/src/public/BaseComponents/View.cs | 3 +++ src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs | 7 +++++++ .../src/public/BaseComponents/ViewPublicMethods.cs | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 5afa20ab158..a0741f5c854 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -944,6 +944,7 @@ public Color BackgroundColor SetInternalBackgroundColorProperty(this, null, value); } NotifyPropertyChanged(); + NotifyBackgroundChanged(); } } @@ -975,6 +976,7 @@ public string BackgroundImage SetInternalBackgroundImageProperty(this, null, value); } NotifyPropertyChanged(); + NotifyBackgroundChanged(); } } @@ -1039,6 +1041,7 @@ public Tizen.NUI.PropertyMap Background SetInternalBackgroundProperty(this, null, value); } NotifyPropertyChanged(); + NotifyBackgroundChanged(); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs index b1cf2fe1f96..70a9557a46f 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -1964,5 +1964,12 @@ private void disposeDebugging(DisposeTypes type) } } + private void NotifyBackgroundChanged() + { + // NOTE + // Notify background modifications caused by one of BackgroundColor, BackgroundImage, Background and ClearBackground() + // By using reserved keyword "_background", user may get notified all background modifications. + NotifyPropertyChanged("_background"); + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs index aa9392309cd..4ed34092100 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs @@ -310,6 +310,8 @@ public void ClearBackground() { Interop.View.ClearBackground(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + NotifyBackgroundChanged(); } ///