Skip to content

Commit

Permalink
[NUI] Notify background change with magic keyword
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyun Yang <[email protected]>
  • Loading branch information
rabbitfor authored and dongsug-song committed Dec 17, 2024
1 parent 75df566 commit efb4da6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ public Color BackgroundColor
SetInternalBackgroundColorProperty(this, null, value);
}
NotifyPropertyChanged();
NotifyBackgroundChanged();
}
}

Expand Down Expand Up @@ -975,6 +976,7 @@ public string BackgroundImage
SetInternalBackgroundImageProperty(this, null, value);
}
NotifyPropertyChanged();
NotifyBackgroundChanged();
}
}

Expand Down Expand Up @@ -1039,6 +1041,7 @@ public Tizen.NUI.PropertyMap Background
SetInternalBackgroundProperty(this, null, value);
}
NotifyPropertyChanged();
NotifyBackgroundChanged();
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
2 changes: 2 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ public void ClearBackground()
{
Interop.View.ClearBackground(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();

NotifyBackgroundChanged();
}

/// <summary>
Expand Down

0 comments on commit efb4da6

Please sign in to comment.