From: woohyun Date: Tue, 9 Jun 2020 05:24:06 +0000 (+0900) Subject: [NUI] Fix style loading issue when extending control classes (#1550) X-Git-Tag: accepted/tizen/unified/20210219.040944~696 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a071b0aca35134e0a72c4f0312db94b35fb30ed;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix style loading issue when extending control classes (#1550) When a NUI.Component.Control class was extended, the default style was not loaded well. This was because searching style logic was executed with not whole base classes but only with the inherited class. Co-authored-by: WooHyun Jung --- diff --git a/src/Tizen.NUI.Components/Controls/Control.cs b/src/Tizen.NUI.Components/Controls/Control.cs index 3ea6fe0..e75413a 100755 --- a/src/Tizen.NUI.Components/Controls/Control.cs +++ b/src/Tizen.NUI.Components/Controls/Control.cs @@ -52,7 +52,16 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public Control() : base() { - ViewStyle viewStyle = StyleManager.Instance.GetComponentStyle(this.GetType()); + var cur_type = this.GetType(); + ViewStyle viewStyle = null; + + do + { + if (cur_type.Equals(typeof(Tizen.NUI.Components.Control))) break; + viewStyle = StyleManager.Instance.GetComponentStyle(cur_type); + cur_type = cur_type.BaseType; + } + while (viewStyle == null); if (viewStyle != null) {