[NUI] Fix issue when user try to get Children of ScrollableBase instance as View
authorAdunFang <xiaohui.fang@samsung.com>
Fri, 9 Jun 2023 01:34:05 +0000 (10:34 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 14 Jun 2023 03:59:37 +0000 (12:59 +0900)
src/Tizen.NUI.Components/Controls/ScrollableBase.cs
src/Tizen.NUI/src/public/Common/Container.cs

index ae694727d8c8fc2922e426d80b9160b29a7377dd..74b678ada02fd9dbd386b3cd55d2346644fbca31 100755 (executable)
@@ -1114,6 +1114,16 @@ namespace Tizen.NUI.Components
             }
         }
 
+        /// <summary>
+        /// return the children of ContentContainer when user try to get the children of ScrollableBase.
+        /// </summary>
+        /// <returns></returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override List<View> GetChildren()
+        {
+            return ContentContainer.Children;
+        }
+
         /// <summary>
         /// Scrolls to the item at the specified index.
         /// </summary>
index 13577bf0c79d13a34251da079cdbce41627f0a99..823ca55af397b4b05cc5e69a6f37ac3d96bf681b 100755 (executable)
@@ -107,7 +107,7 @@ namespace Tizen.NUI
         {
             get
             {
-                return childViews;
+                return GetChildren();
             }
         }
 
@@ -326,6 +326,16 @@ namespace Tizen.NUI
                 OnResourcesChanged(changedResources);
         }
 
+        /// <summary>
+        /// Some type which inherit from Container overwrite the Add/Remove, so the getter of children should also be overwrite.
+        /// </summary>
+        /// <returns></returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual List<View> GetChildren()
+        {
+            return childViews;
+        }
+
         /// <summary>
         /// Invoked whenever the binding context of the element changes. Implement this method to add class handling for this event.
         /// </summary>