From c83d3d9e0418a59ac8a3db39357efade2b99c97e Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Tue, 25 Oct 2022 18:58:22 +0900 Subject: [PATCH] [NUI] Modify TabView and TabBar to help customizing classes To help application to customize TabView and TabBar, some methods and properties have been modified. --- src/Tizen.NUI.Components/Controls/TabBar.cs | 4 ++-- src/Tizen.NUI.Components/Controls/TabView.cs | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/TabBar.cs b/src/Tizen.NUI.Components/Controls/TabBar.cs index 5daadd1..e40ddb2 100755 --- a/src/Tizen.NUI.Components/Controls/TabBar.cs +++ b/src/Tizen.NUI.Components/Controls/TabBar.cs @@ -108,7 +108,7 @@ namespace Tizen.NUI.Components /// A tab button to be added to TabBar. /// Thrown when the argument tabButton is null. [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 /// Thrown when the argument tabButton is null. /// Thrown when the argument tabButton does not exist in TabBar. [EditorBrowsable(EditorBrowsableState.Never)] - protected internal void RemoveTabButton(TabButton tabButton) + protected internal virtual void RemoveTabButton(TabButton tabButton) { if (tabButton == null) { diff --git a/src/Tizen.NUI.Components/Controls/TabView.cs b/src/Tizen.NUI.Components/Controls/TabView.cs index ec70f8c..87fdcdf 100755 --- a/src/Tizen.NUI.Components/Controls/TabView.cs +++ b/src/Tizen.NUI.Components/Controls/TabView.cs @@ -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); + } } /// @@ -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); + } } /// -- 2.7.4