[NUI] Modify TabView and TabBar to help customizing classes
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 25 Oct 2022 09:58:22 +0000 (18:58 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 10 Nov 2022 01:25:11 +0000 (10:25 +0900)
To help application to customize TabView and TabBar, some methods and
properties have been modified.

src/Tizen.NUI.Components/Controls/TabBar.cs
src/Tizen.NUI.Components/Controls/TabView.cs

index 5daadd1..e40ddb2 100755 (executable)
@@ -108,7 +108,7 @@ namespace Tizen.NUI.Components
         /// <param name="tabButton">A tab button to be added to TabBar.</param>
         /// <exception cref="ArgumentNullException">Thrown when the argument tabButton is null.</exception>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected internal void AddTabButton(TabButton tabButton)
+        protected internal virtual void AddTabButton(TabButton tabButton)
         {
             if (tabButton == null)
             {
@@ -157,7 +157,7 @@ namespace Tizen.NUI.Components
         /// <exception cref="ArgumentNullException">Thrown when the argument tabButton is null.</exception>
         /// <exception cref="ArgumentException">Thrown when the argument tabButton does not exist in TabBar.</exception>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected internal void RemoveTabButton(TabButton tabButton)
+        protected internal virtual void RemoveTabButton(TabButton tabButton)
         {
             if (tabButton == null)
             {
index ec70f8c..87fdcdf 100755 (executable)
@@ -156,6 +156,19 @@ namespace Tizen.NUI.Components
             {
                 return tabBar;
             }
+
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            protected set
+            {
+                if (tabBar != null)
+                {
+                    tabBar.TabButtonSelected -= tabButtonSelectedHandler;
+                    Utility.Dispose(tabBar);
+                }
+
+                tabBar = value;
+                Add(tabBar);
+            }
         }
 
         /// <summary>
@@ -168,6 +181,18 @@ namespace Tizen.NUI.Components
             {
                 return content;
             }
+
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            protected set
+            {
+                if (content != null)
+                {
+                    Utility.Dispose(content);
+                }
+
+                content = value;
+                Add(content);
+            }
         }
 
         /// <summary>