Revert "[NUI] Refactoring Theme and StyleManager (#1981)" (#2013)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Popup.cs
index bc77658..9a44d4a 100755 (executable)
@@ -27,208 +27,189 @@ namespace Tizen.NUI.Components
     /// User can handle Popup button count, head title and content area.
     /// </summary>
     /// <since_tizen> 6 </since_tizen>
+    [Obsolete("Deprecated in API8; Will be removed in API10")]
     public class Popup : Control
     {
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonCountProperty = BindableProperty.Create("ButtonCount", typeof(int), typeof(Popup), 0, propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonHeightProperty = BindableProperty.Create(nameof(ButtonHeight), typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
-            if ((int)newValue != instance.buttonCount)
+            if (newValue != null && instance?.popupStyle?.Buttons?.Size != null )
             {
-                instance.buttonCount = (int)newValue;
-                instance.UpdateButton();
+                instance.popupStyle.Buttons.Size.Height = (int)newValue;
+                instance.btGroup.Itemheight = (int)newValue;
+                instance.UpdateView();
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.buttonCount;
+            return (int)(instance.popupStyle?.Buttons?.Size?.Height ?? 0);
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create("ShadowOffset", typeof(Vector4), typeof(Popup), new Vector4(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonTextPointSizeProperty = BindableProperty.Create(nameof(ButtonTextPointSize), typeof(float), typeof(Popup), default(float), propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
             if (newValue != null)
             {
-                if (instance.Style.ShadowOffset == null)
+                if (instance.popupStyle?.Buttons?.Text != null)
                 {
-                    instance.Style.ShadowOffset = new Vector4(0, 0, 0, 0);
+                    instance.popupStyle.Buttons.Text.PointSize = (float)newValue;
                 }
-                instance.Style.ShadowOffset = (Vector4)newValue;
-                instance.UpdateShadow();
+                instance.btGroup.ItemPointSize = (float)newValue;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.ShadowOffset;
+            return instance.popupStyle?.Buttons?.Text?.PointSize?.All ?? 0;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonHeightProperty = BindableProperty.Create("ButtonHeight", typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonFontFamilyProperty = BindableProperty.Create(nameof(ButtonFontFamily), typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
             if (newValue != null)
             {
-                instance.Style.Buttons.Size.Height = (int)newValue;
-                instance.UpdateButton();
+                instance.popupStyle.Buttons.Text.FontFamily = (string)newValue;
+                instance.btGroup.ItemFontFamily = (string)newValue;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Size?.Height ?? 0;
+            return instance.popupStyle?.Buttons?.Text?.FontFamily.All;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonTextPointSizeProperty = BindableProperty.Create("ButtonTextPointSize", typeof(float), typeof(Popup), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonTextColorProperty = BindableProperty.Create(nameof(ButtonTextColor), typeof(Color), typeof(Popup), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
             if (newValue != null)
-            {
-                if (instance.Style.Buttons.Text.PointSize == null)
+            {  
+                if (instance.popupStyle?.Buttons?.Text != null)
                 {
-                    instance.Style.Buttons.Text.PointSize = new Selector<float?>();
+                    instance.popupStyle.Buttons.Text.TextColor = (Color)newValue;
                 }
-                instance.Style.Buttons.Text.PointSize.All = (float)newValue;
-                instance.UpdateButton();
+                instance.btGroup.ItemTextColor = (Color)newValue;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Text?.PointSize?.All ?? 0;
+            return instance.popupStyle?.Buttons?.Text?.TextColor?.All;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonFontFamilyProperty = BindableProperty.Create("ButtonFontFamily", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonOverLayBackgroundColorSelectorProperty = BindableProperty.Create(nameof(ButtonOverLayBackgroundColorSelector), typeof(Selector<Color>), typeof(Popup), new Selector<Color>(), propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
             if (newValue != null)
             {
-                instance.Style.Buttons.Text.FontFamily = (string)newValue;
-                instance.UpdateButton();
-            }
-        },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Text?.FontFamily;
-        });
-
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonTextColorProperty = BindableProperty.Create("ButtonTextColor", typeof(Color), typeof(Popup), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) =>
-        {
-            var instance = (Popup)bindable;
-            if (newValue != null)
-            {  
-                if (instance.Style.Buttons.Text.TextColor == null)
-                {
-                    instance.Style.Buttons.Text.TextColor = new Selector<Color>();
-                }
-                instance.Style.Buttons.Text.TextColor.All = (Color)newValue;
-                //instance.UpdateButton();
+                instance.popupStyle.Buttons.Overlay.BackgroundColor = (Selector<Color>)newValue;
+                instance.btGroup.OverLayBackgroundColorSelector = (Selector<Color>)newValue;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Text?.TextColor?.All;
+            return instance.popupStyle?.Buttons?.Overlay?.BackgroundColor;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonOverLayBackgroundColorSelectorProperty = BindableProperty.Create("ButtonOverLayBackgroundColorSelector", typeof(Selector<Color>), typeof(Popup), new Selector<Color>(), propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonTextAlignmentProperty = BindableProperty.Create(nameof(ButtonTextAlignment), typeof(HorizontalAlignment), typeof(Popup), new HorizontalAlignment(), propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
             if (newValue != null)
             {
-                instance.Style.Buttons.Overlay.BackgroundColor = (Selector<Color>)newValue;
-                instance.UpdateButton();
+                instance.popupStyle.Buttons.Text.HorizontalAlignment = (HorizontalAlignment)newValue;
+                instance.btGroup.ItemTextAlignment = (HorizontalAlignment)newValue;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Overlay?.BackgroundColor;
+            return instance.popupStyle?.Buttons?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonTextAlignmentProperty = BindableProperty.Create("ButtonTextAlignment", typeof(HorizontalAlignment), typeof(Popup), new HorizontalAlignment(), propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonBackgroundProperty = BindableProperty.Create(nameof(ButtonBackground), typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
             if (newValue != null)
             {
-                instance.Style.Buttons.Text.HorizontalAlignment = (HorizontalAlignment)newValue;
-                instance.UpdateButton();
+                if (instance.popupStyle.Buttons.BackgroundImage == null)
+                {
+                    instance.popupStyle.Buttons.BackgroundImage = new Selector<string>();
+                }
+                instance.popupStyle.Buttons.BackgroundColor = new Selector<Color>();
+                instance.popupStyle.Buttons.BackgroundImage = (string)newValue;
+                instance.btGroup.ItemBackgroundImageUrl = (string)newValue;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
+            return instance.popupStyle?.Buttons?.BackgroundImage?.All;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonBackgroundProperty = BindableProperty.Create("ButtonBackground", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonBackgroundBorderProperty = BindableProperty.Create(nameof(ButtonBackgroundBorder), typeof(Rectangle), typeof(Popup), new Rectangle(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
             if (newValue != null)
             {
-                if (instance.Style.Buttons.Background.ResourceUrl == null)
+                if (instance.popupStyle.Buttons.BackgroundImageBorder == null)
                 {
-                    instance.Style.Buttons.Background.ResourceUrl = new Selector<string>();
+                    instance.popupStyle.Buttons.BackgroundImageBorder = new Selector<Rectangle>();
                 }
-                instance.Style.Buttons.Background.ResourceUrl.All = (string)newValue;
-                instance.UpdateButton();
+                instance.popupStyle.Buttons.BackgroundImageBorder = (Rectangle)newValue;
+                instance.btGroup.ItemBackgroundBorder = (Rectangle)newValue;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Background?.ResourceUrl?.All;
+            return instance.popupStyle?.Buttons?.BackgroundImageBorder?.All;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty ButtonBackgroundBorderProperty = BindableProperty.Create("ButtonBackgroundBorder", typeof(Rectangle), typeof(Popup), new Rectangle(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty ButtonImageShadowProperty = BindableProperty.Create(nameof(ButtonImageShadow), typeof(ImageShadow), typeof(Popup), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Popup)bindable;
-            if (newValue != null)
-            {
-                if (instance.Style.Buttons.Background.Border == null)
-                {
-                    instance.Style.Buttons.Background.Border = new Selector<Rectangle>();
-                }
-                instance.Style.Buttons.Background.Border.All = (Rectangle)newValue;
-                instance.UpdateButton();
-            }
+            ImageShadow shadow = (ImageShadow)newValue;
+            instance.btGroup.ItemImageShadow = new ImageShadow(shadow);
+            instance.popupStyle.Buttons.ImageShadow = new ImageShadow(shadow);
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Background?.Border?.All;
+            return instance.popupStyle?.Buttons?.ImageShadow?.All;
         });
 
-        private TextLabel titleText;
-        private List<Button> buttonList;
-        private List<string> buttonTextList = new List<string>();
 
-        private int buttonCount = 0;
+        private PopupStyle popupStyle => ViewStyle as PopupStyle;
+        private TextLabel titleText;
+        private ButtonGroup btGroup = null;
+        private Window window = null;
+        private Layer container = new Layer();
+        static Popup() { }
 
         /// <summary>
         /// Creates a new instance of a Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public Popup() : base()
         {
             Initialize();
@@ -238,8 +219,6 @@ namespace Tizen.NUI.Components
         /// Creates a new instance of a Popup with style.
         /// </summary>
         /// <param name="style">Create Popup by special style defined in UX.</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Popup(string style) : base(style)
         {
@@ -247,49 +226,167 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Creates a new instance of a Popup with attributes.
+        /// Creates a new instance of a Popup with style.
         /// </summary>
-        /// <param name="attributes">Create Popup by attributes customized by user.</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <param name="popupStyle">Create Popup by style customized by user.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Popup(PopupStyle attributes) : base(attributes)
+        public Popup(PopupStyle popupStyle) : base(popupStyle)
         {
             Initialize();
         }
 
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public virtual void Post(Window targetWindow)
+        {
+            if (targetWindow == null)
+            {
+                return;
+            }
+
+            window = targetWindow;
+            window.AddLayer(container);
+            container.RaiseToTop();
+        }
+
+        /// <summary>
+        /// Dismiss the dialog
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public virtual void Dismiss()
+        {
+            if (window == null)
+            {
+                return;
+            }
+
+            window.RemoveLayer(container);
+            window = null;
+        }
+
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddButton(string buttonText)
+        {
+            if (popupStyle.Buttons != null)
+            {
+                Button btn = new Button(popupStyle.Buttons);
+                btn.Text = buttonText;
+                btn.ClickEvent += ButtonClickEvent;
+                btGroup.AddItem(btn);
+                UpdateView();
+            }
+        }
+
+        /// <summary>
+        /// Add button by style's name.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddButton(string buttonText, string style)
+        {
+            AddButton(buttonText);
+        }
+
+        /// <summary>
+        /// Add button by style.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddButton(string buttonText, ButtonStyle style)
+        {
+            if (popupStyle.Buttons != null && style != null)
+            {
+                popupStyle.Buttons.CopyFrom(style);
+                AddButton(buttonText);
+            }
+        }
+
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Button GetButton(int index)
+        {
+            return btGroup.GetItem(index);
+        }
+
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void RemoveButton(int index)
+        {
+            btGroup.RemoveItem(index);
+        }
+
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddContentText(View childView)
+        {
+            if (null != ContentView)
+            {
+                ContentView.Add(childView);
+            }
+            UpdateView();
+        }
+
         /// <summary>
         /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public event EventHandler<ButtonClickEventArgs> PopupButtonClickEvent;
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <summary>
+        /// Get style of popup.
+        /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public new PopupStyle Style => ViewStyle as PopupStyle;
+        public new PopupStyle Style
+        {
+            get
+            {
+                var result = new PopupStyle(popupStyle);
+                result.CopyPropertiesFromView(this);
+                result.Title.CopyPropertiesFromView(titleText);
+                return result;
+            }
+        }
+
+        /// <summary>
+        /// Popup Title.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public TextLabel Title
+        {
+            get
+            {
+                if (null == titleText)
+                {
+                    titleText = new TextLabel();
+                    Add(titleText);
+                }
+                return titleText;
+            }
+            internal set
+            {
+                titleText = value;
+            }
+        }
 
         /// <summary>
         /// Title text string in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public string TitleText
         {
             get
             {
-                return Style.Title?.Text?.All;
+                return popupStyle?.Title?.Text?.All;
             }
             set
             {
                 if (value != null)
                 {
-                    //CreateTitleTextAttributes();
-                    if (Style.Title.Text == null)
+                    if (popupStyle?.Title != null)
                     {
-                        Style.Title.Text = new StringSelector();
+                        popupStyle.Title.Text = value;
                     }
-                    Style.Title.Text.All = value;
-
-                    //RelayoutRequest();
                 }
             }
         }
@@ -298,21 +395,19 @@ namespace Tizen.NUI.Components
         /// Title text point size in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public float TitlePointSize
         {
             get
             {
-                return Style.Title?.PointSize?.All ?? 0;
+                return popupStyle?.Title?.PointSize?.All ?? 0;
             }
             set
             {
-                //CreateTitleTextAttributes();
-                if (Style.Title.PointSize == null)
+                if (popupStyle?.Title != null)
                 {
-                    Style.Title.PointSize = new FloatSelector();
+                    popupStyle.Title.PointSize = value;
                 }
-                Style.Title.PointSize.All = value;
-                //RelayoutRequest();
             }
         }
 
@@ -320,21 +415,19 @@ namespace Tizen.NUI.Components
         /// Title text color in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public Color TitleTextColor
         {
             get
             {
-                return Style.Title?.TextColor?.All;
+                return popupStyle?.Title?.TextColor?.All;
             }
             set
             {
-                //CreateTitleTextAttributes();
-                if (Style.Title.TextColor == null)
+                if (popupStyle?.Title != null)
                 {
-                    Style.Title.TextColor = new ColorSelector();
+                    popupStyle.Title.TextColor = value;
                 }
-                Style.Title.TextColor.All = value;
-                //RelayoutRequest();
             }
         }
 
@@ -342,17 +435,16 @@ namespace Tizen.NUI.Components
         /// Title text horizontal alignment in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public HorizontalAlignment TitleTextHorizontalAlignment
         {
             get
             {
-                return Style.Title?.HorizontalAlignment ?? HorizontalAlignment.Center;
+                return popupStyle?.Title?.HorizontalAlignment ?? HorizontalAlignment.Center;
             }
             set
             {
-                //CreateTitleTextAttributes();
-                Style.Title.HorizontalAlignment = value;
-                //RelayoutRequest();
+                popupStyle.Title.HorizontalAlignment = value;
             }
         }
 
@@ -360,17 +452,16 @@ namespace Tizen.NUI.Components
         /// Title text's position in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public Position TitleTextPosition
         {
             get
             {
-                return Style.Title?.Position ?? new Position(0, 0, 0);
+                return popupStyle?.Title?.Position ?? new Position(0, 0, 0);
             }
             set
             {
-                //CreateTitleTextAttributes();
-                Style.Title.Position = value;
-                //RelayoutRequest();
+                popupStyle.Title.Position = value;
             }
         }
 
@@ -378,17 +469,19 @@ namespace Tizen.NUI.Components
         /// Title text's height in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public int TitleHeight
         {
             get
             {
-                return (int)(Style.Title?.Size?.Height ?? 0);
+                return (int)(popupStyle?.Title?.Size?.Height ?? 0);
             }
             set
             {
-                //CreateTitleTextAttributes();
-                Style.Title.Size.Height = value;
-                //RelayoutRequest();
+                if (popupStyle?.Title?.Size != null)
+                {
+                    popupStyle.Title.Size.Height = value;
+                }
             }
         }
 
@@ -396,6 +489,7 @@ namespace Tizen.NUI.Components
         /// Content view in Popup, only can be gotten.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public View ContentView
         {
             get;
@@ -406,40 +500,18 @@ namespace Tizen.NUI.Components
         /// Button count in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public int ButtonCount
         {
-            get
-            {
-                return (int)GetValue(ButtonCountProperty);
-            }
-            set
-            {
-                SetValue(ButtonCountProperty, value);
-            }
-        }
-
-        /// <summary>
-        /// Shadow offset in Popup, including left, right, up and bottom offset.
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public Vector4 ShadowOffset
-        {
-            get
-            {
-                return (Vector4)GetValue(ShadowOffsetProperty);
-            }
-            set
-            {
-                SetValue(ShadowOffsetProperty, value);
-            }
+            get;
+            set;
         }
 
         /// <summary>
         /// Button height in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public int ButtonHeight
         {
             get
@@ -456,6 +528,7 @@ namespace Tizen.NUI.Components
         /// Button text point size in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public float ButtonTextPointSize
         {
             get
@@ -472,6 +545,7 @@ namespace Tizen.NUI.Components
         /// Button text font family in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public string ButtonFontFamily
         {
             get
@@ -488,6 +562,7 @@ namespace Tizen.NUI.Components
         /// Button text color in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public Color ButtonTextColor
         {
             get
@@ -522,6 +597,7 @@ namespace Tizen.NUI.Components
         /// Button text horizontal alignment in Popup.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public HorizontalAlignment ButtonTextAlignment
         {
             get
@@ -540,7 +616,7 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public string ButtonBackgroundImageURL
+        public string ButtonBackground
         {
             get
             {     
@@ -558,7 +634,7 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Rectangle ButtonBackgroundImageBorder
+        public Rectangle ButtonBackgroundBorder
         {
             get
             {
@@ -571,42 +647,29 @@ namespace Tizen.NUI.Components
             }
         }
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <summary>
+        /// Button's image shadow in Popup.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public new Size2D Size2D
+        public ImageShadow ButtonImageShadow
         {
-            get
-            {
-                return base.Size2D;
-            }
-            set
-            {
-                base.Size2D = value;
-                UpdateShadow();
-            }
+            get => (ImageShadow)GetValue(ButtonImageShadowProperty);
+            set => SetValue(ButtonImageShadowProperty, value);
         }
 
+
         /// <summary>
         /// Set button text by index.
         /// </summary>
         /// <param name="index">Button index.</param>
         /// <param name="text">Button text string.</param>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public void SetButtonText(int index, string text)
         {
-            if(index < 0 && index >= buttonCount)
-            {
-                return;
-            }
-            if(buttonTextList.Count < index + 1)
-            {
-                for (int i = buttonTextList.Count; i < index + 1; i++)
-                {
-                    buttonTextList.Add("");
-                }
-            }
-            buttonTextList[index] = text;
-            UpdateButton();
+            AddButton(text);
         }
 
         /// <summary>
@@ -614,6 +677,7 @@ namespace Tizen.NUI.Components
         /// </summary>
         /// <param name="type">Dispose type.</param>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         protected override void Dispose(DisposeTypes type)
         {
             if (disposed)
@@ -635,13 +699,11 @@ namespace Tizen.NUI.Components
                     ContentView.Dispose();
                     ContentView = null;
                 }
-                if (buttonList != null)
+
+                if (btGroup != null)
                 {
-                    foreach(Button btn in buttonList)
-                    {
-                        Remove(btn);
-                        btn.Dispose();
-                    }
+                    btGroup.Dispose();
+                    btGroup = null;
                 }
             }
 
@@ -670,33 +732,28 @@ namespace Tizen.NUI.Components
             base.OnFocusLost();
         }
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <summary>
+        /// Apply style to popup.
+        /// </summary>
+        /// <param name="viewStyle">The style to apply.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void ApplyStyle(ViewStyle viewStyle)
         {
             base.ApplyStyle(viewStyle);
-
-            PopupStyle popupStyle = viewStyle as PopupStyle;
-
-            if (null != popupStyle)
+            PopupStyle ppStyle = viewStyle as PopupStyle;
+            if (null != ppStyle)
             {
-                if (null == titleText)
-                {
-                    titleText = new TextLabel();
-                    Add(titleText);
-                }
-
-                titleText.ApplyStyle(Style.Title);
+                Title.ApplyStyle(ppStyle.Title);
+                Title.RaiseToTop();
             }
         }
 
         /// <summary>
-        /// Get Popup attribues.
+        /// Get Popup style.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <returns>The default popup style.</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override ViewStyle GetViewStyle()
+        protected override ViewStyle CreateViewStyle()
         {
             return new PopupStyle();
         }
@@ -704,22 +761,27 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Theme change callback when theme is changed, this callback will be trigger.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+        /// <param name="sender">The sender</param>
+        /// <param name="e">The event data</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
         {
-            PopupStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as PopupStyle;
-            if (tempAttributes != null)
+            PopupStyle ppStyle = StyleManager.Instance.GetViewStyle(StyleName) as PopupStyle;
+            if (ppStyle != null)
             {
-                Style.CopyFrom(tempAttributes);
-                RelayoutRequest();
+                ApplyStyle(ppStyle);
+                UpdateView();
             }
         }
 
         private void Initialize()
         {
+            container.Add(this);
+            container.SetTouchConsumed(true);
+            container.SetHoverConsumed(true);
+
             LeaveRequired = true;
+            PropertyChanged += PopupStylePropertyChanged;
 
             // ContentView
             ContentView = new View()
@@ -731,77 +793,25 @@ namespace Tizen.NUI.Components
             Add(ContentView);
             ContentView.RaiseToTop();
 
-            // Title
-            if (null == titleText)
-            {
-                titleText = new TextLabel();
-                Add(titleText);
-            }
-
-            buttonList = new List<Button>();
+            // Button
+            btGroup = new ButtonGroup(this);
         }
 
-        private void UpdateButton()
+        private void UpdateView()
         {
-            if (buttonCount <= 0) return;
-            if (buttonTextList.Count != buttonCount) return;
-
-            if (buttonList != null)
-            {
-                foreach (Button btn in buttonList)
-                {
-                    btn.ClickEvent -= ButtonClickEvent;
-                    this.Remove(btn);
-                    btn.Dispose();
-                }
-                buttonList.Clear();
-            }
-
-            int buttonWidth = Size2D.Width / buttonCount;
-            int buttonHeight = (int)Style.Buttons.Size.Height;
-            for (int i = 0; i < buttonCount; i++)
-            {             
-                Button btn = new Button(Style.Buttons);
-                btn.Size2D = new Size2D(buttonWidth, buttonHeight);
-                btn.Style.Text.Text = buttonTextList[i];
-                btn.ClickEvent += ButtonClickEvent;
-
-                this.Add(btn);
-                buttonList.Add(btn);
-            }
-
-            int pos = 0;
-            if (buttonList != null && buttonList.Count > 0)
-            {
-                if (LayoutDirection == ViewLayoutDirectionType.RTL)
-                {
-                    for (int i = buttonList.Count - 1; i >= 0; i--)
-                    {
-                        buttonList[i].PositionX = pos;
-                        pos += buttonList[i].Size2D.Width;
-                    }
-                }
-                else
-                {
-                    for (int i = 0; i < buttonList.Count; i++)
-                    {
-                        buttonList[i].PositionX = pos;
-                        pos += buttonList[i].Size2D.Width;
-                    }
-                }
-            }
-
+            btGroup.UpdateButton(popupStyle.Buttons);
             UpdateContentView();
+            UpdateTitle();
         }
 
         private void ButtonClickEvent(object sender, Button.ClickEventArgs e)
         {
-            if (PopupButtonClickEvent != null && buttonList != null)
+            if (PopupButtonClickEvent != null && btGroup.Count > 0)
             {
                 Button button = sender as Button;
-                for (int i = 0; i < buttonList.Count; i++)
+                for (int i = 0; i < btGroup.Count; i++)
                 {
-                    if(button == buttonList[i])
+                    if (button == GetButton(i))
                     {
                         ButtonClickEventArgs args = new ButtonClickEventArgs();
                         args.ButtonIndex = i;
@@ -810,100 +820,59 @@ namespace Tizen.NUI.Components
                 }
             }
         }
-        private void UpdateShadow()
+
+        private void PopupStylePropertyChanged(object sender, PropertyChangedEventArgs e)
         {
-            if (Style.ShadowOffset == null) return;
-            int w = 0;
-            int h = 0;
-            if (Style.Shadow != null)
+            if (e.PropertyName.Equals("LayoutDirection"))
             {
-                w = (int)(Size2D.Width + Style.ShadowOffset.W + Style.ShadowOffset.X);
-                h = (int)(Size2D.Height + Style.ShadowOffset.Y + Style.ShadowOffset.Z);
-
-                shadowImage.Size2D = new Size2D(w, h);
+                btGroup.UpdateButton(popupStyle.Buttons);
             }
         }
 
-        private void UpdateTitle()
+        private void UpdateContentView()
         {
-            int w = 0;
-            int h = 0;
             int titleX = 0;
             int titleY = 0;
             int titleH = 0;
             int buttonH = 0;
-
-            if (Style.Title != null)
+            string strText = Title.Text;
+            if (!string.IsNullOrEmpty(strText) && Title.Size != null)
             {
-                if (titleText.Text != null && titleText.Text != "")
-                {
-                    Style.Title.Text = new Selector<string> { All = titleText.Text };
-                    w = (int)(Size2D.Width - titleText.PositionX * 2);
-
-                    if (Style.Title.Size != null)
-                    {
-                        titleH = (int)titleText.Size.Height;
-                    }
-                    titleText.Size2D = new Size2D(w, titleH);                 
-                }
-                else
-                {
-                    titleText.Size2D = new Size2D(0, 0);
-                }
+                titleH = (int)titleText.Size.Height;
             }
 
-            if (titleText != null)
+            if (!string.IsNullOrEmpty(strText) && Title.Position != null)
             {
-                if (LayoutDirection == ViewLayoutDirectionType.RTL)
-                {
-                    if (Style.Title != null)
-                    {
-                        Style.Title.HorizontalAlignment = HorizontalAlignment.End;
-                    }
-                    titleText.HorizontalAlignment = HorizontalAlignment.End;
-                }
-                else if (LayoutDirection == ViewLayoutDirectionType.LTR)
-                {
-                    if (Style.Title != null)
-                    {
-                        Style.Title.HorizontalAlignment = HorizontalAlignment.Begin;
-                    }
-                    titleText.HorizontalAlignment = HorizontalAlignment.Begin;
-                }
+                titleX = (int)Title.Position.X;
+                titleY = (int)Title.Position.Y;
             }
 
-            UpdateContentView();
+            if (btGroup.Count != 0 && popupStyle?.Buttons?.Size != null )
+            {
+                buttonH = (int)popupStyle.Buttons.Size.Height;
+            }
+            ContentView.Size = new Size(Size.Width - titleX * 2, Size.Height - titleY - titleH - buttonH);
+            ContentView.Position = new Position(titleX, titleY + titleH);
+            ContentView.RaiseToTop();
         }
 
-        private void UpdateContentView()
+        private void UpdateTitle()
         {
-            int titleX = 0;
-            int titleY = 0;
-            int titleH = 0;
-            if (Style.Title.Size != null)
-            {
-                titleH = (int)titleText.Size.Height;
-            }
-            if (Style.Title.Position != null)
+            if (titleText != null && string.IsNullOrEmpty(popupStyle.Title.Text.All) && popupStyle.Title.Size != null)
             {
-                titleX = (int)Style.Title.Position.X;
-                titleY = (int)Style.Title.Position.Y;
+                titleText.RaiseToTop();
             }
-            int buttonH = (int)Style.Buttons.Size.Height;
-
-            ContentView.Size2D = new Size2D(Size2D.Width - titleX * 2, Size2D.Height - titleY - titleH - buttonH);
-            ContentView.Position2D = new Position2D(titleX, titleY + titleH);
-            ContentView.RaiseToTop();
         }
-
         /// <summary>
         /// ButtonClickEventArgs is a class to record button click event arguments which will sent to user.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10")]
         public class ButtonClickEventArgs : EventArgs
         {
             /// <summary> Button index which is clicked in Popup </summary>
             /// <since_tizen> 6 </since_tizen>
+            [Obsolete("Deprecated in API8; Will be removed in API10")]
             public int ButtonIndex;
         }
     }